我尝试将Datatable的pageLength设置为6,但它并没有显示6个计数。见附图
$('#tblProviders').dataTable({
"autoWidth": false,
"searching": false,
"pageLength": 6,
"bDestroy": true,
data: data,
columns: [
{ "data": "ProviderName" },
{ "data": "ProviderQualificationTime" },
{ "data": "TotalServiceableOffers" }
]
});
答案 0 :(得分:1)
在代码中添加lengthMenu
"lengthMenu": [
[6,10, 20, 50, 100, 150, -1],
[6,10, 20, 50, 100, 150, "All"] // change per page values here
],