其实你需要玩一点sDom选项。从文档采取:
This initialisation variable allows you to specify exactly where in the DOM you want DataTables to inject the various controls it adds to the page (for example you might want the pagination controls at the top of the table). DIV elements (with or without a custom class) can also be added to aid styling. The follow syntax is used:
The following options are allowed:
'l' - Length changing
'f' - Filtering input
't' - The table!
'i' - Information
'p' - Pagination
'r' - pRocessing
The following constants are allowed:
'H' - jQueryUI theme "header" classes ('fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix')
'F' - jQueryUI theme "footer" classes ('fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix')
The following syntax is expected:
'<' and '>' - div elements
'<"class" and '>' - div with a class
'<"#id" and '>' - div with an ID
Examples:
'<"wrapper"flipt>', '<lf<t>ip>'
所以例如如果这样做(我想你正在使用jquery UI <“H” LFR>吨<“F” IP>你有长度改变,所述过滤器和所述“正在处理...“(如果你已经启用了ajax),你有了这个表格,那么你就可以在页脚中获得信息和分页信息了,如果你希望你可以多次使用这些字母,那么你可以把信息两次或三次,如果你想
编辑 - 在您的评论你说你要添加表格的TFOOT在这种情况下,你可以只手动添加:。
$(document).ready(function() {
$('#usersPageList').dataTable({
"sDom": 'rti<"pagination"p>',//add i here this is the number of records
"iDisplayLength": 1,
"sPaginationType": "full_numbers",
});
var info = $('.dataTables_info')
$('tfoot').append(info);
});
意识到'sinfo',因为我可以帮忙。 –
我正在寻找的主要部分是显示x行总数x或其他。 –