其實你需要玩一點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或其他。 –