jQuery DataTables - Slow initiation, “Normal” html table shown in the beginning

后端 未结 10 1299
旧时难觅i
旧时难觅i 2021-02-03 22:01

I\'m using jQuery DataTable plugin, but I got a concern where the scripts loading seems to take some time, so my web page is always displaying the ordinary html table first, and

10条回答
  •  一向
    一向 (楼主)
    2021-02-03 22:56

    I did a very simple solution that works fine. In the DataTable initialization I used the method show():

    $(document).ready(function() {
        $('#example').dataTable({
            "order": [[ 0, 'asc' ]]
        });
        $('#example').show();
    } );
    

    ... and in the HTML table I put the style display:none:

    Good luck!

    提交回复
    热议问题