Datatables - on page load, table layout does not load instantly

后端 未结 1 523
小鲜肉
小鲜肉 2021-01-02 22:52

There\'s a problem with datatables.js - when the page loads, the css with pagination is slightly delayed, so the whole data shows very quickly initally before it shows the c

相关标签:
1条回答
  • 2021-01-02 23:00

    As per the comment:

    CSS:

    #list {
        display: none;
    }
    

    JS:

    $('#list').DataTable({
        "columns": [ 
            { 
                "width": "45%" 
            }, 
            null, 
            null
        ],
        "initComplete": function(){ 
            $("#list").show(); 
        }
    });
    

    Working JSFidlle here. Hope that helps.

    0 讨论(0)
提交回复
热议问题