How to change results per page value in datatables

前端 未结 7 1062
日久生厌
日久生厌 2021-01-30 21:35

Datatables has an option to select the number of records shown per page. The default value starts from 10, 25, 50 and 100. How can I change it to start from 5 instead of 10? 10

7条回答
  •  执念已碎
    2021-01-30 21:59

    You will want to use the iDisplayLength parameter when you initialize the DataTable object. Here's the example they list in their documentation:

    $(document).ready( function() {
        $('#example').dataTable( {
            "iDisplayLength": 50
        } );
    } )
    

    More information can be found here: http://www.datatables.net/usage/options

提交回复
热议问题