id在方案之后,每个数据表控件都以唯一的名称命名<tableid>_info,<tableid>_pagination依此类推.所以他们很容易找到然后四处走动.
如果你有一个表,#example你可能会像这样初始化dataTable:
var dataTable = $('#example').dataTable({
sPaginationType: "full_numbers"
})
Run Code Online (Sandbox Code Playgroud)
然后,将控件移动到表格上方,如下所示:
$("#example_info").detach().prependTo('#example_wrapper');
$("#example_paginate").detach().prependTo('#example_wrapper');
Run Code Online (Sandbox Code Playgroud)
并且为避免两个控件垂直错位:
#example_info {
clear: none;
}
Run Code Online (Sandbox Code Playgroud)
看工作小提琴 - > http://jsfiddle.net/C6CWE/