如何更改数据表中每页值的结果 [英] How to change results per page value in datatables
本文介绍了如何更改数据表中每页值的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Datatables 有一个选项可以选择每页显示的记录数.默认值从 10、25、50 和 100 开始.如何将其更改为从 5 开始而不是 10?10 条记录有点太多了,在我目前的设计中占用了大量空间.谢谢!
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.net/usage/options一个>
More information can be found here: http://www.datatables.net/usage/options
这篇关于如何更改数据表中每页值的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文