如何在数据表中更改每页的结果值 [英] How to change results per page value in datatables
本文介绍了如何在数据表中更改每页的结果值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Datatables可以选择每页显示的记录数。默认值从10,25,50和100开始。如何将其更改为从5而不是10开始?
10条记录有点太多,在我目前的设计中占用了大量的空间。
Thanx!
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 records is a bit too much and takes a lot of space in my current design. Thanx!
推荐答案
您将在初始化DataTable对象时使用iDisplayLength参数。以下是他们在文档中列出的示例:
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
} );
} )
可以在这里找到更多信息: http://www.datatables。净/使用/选项
More information can be found here: http://www.datatables.net/usage/options
这篇关于如何在数据表中更改每页的结果值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文