How to change results per page value in datatables

前端 未结 7 1173
日久生厌
日久生厌 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 22:02

    $.extend(true, $.fn.dataTable.defaults, {
        "lengthMenu": [[5, 10, 15, 20, 25], [5, 10, 15, 20, 25]],
        "pageLength": 5
    
    });
    

提交回复
热议问题