将 tableinfo 粘贴到 jqueryDatable 中的特定位置

Stick tableinfo to specific place in jqueryDatable

大家好! 我正在尝试将 tableInfo 粘贴到 jquery DataTable 中,就像这样

但是,当我更改显示列表中的值时,信息会向下滑动到列的中间,就像这样

我尝试了 css 的不同变体来解决这个问题,但我失败了。现在我使用这个代码

.dataTables_wrapper .dataTables_info {
clear: both;
float: right;
margin-top: -510px;
margin-right: -550px;

您知道如何解决这个问题吗?

使用infoCallback生成所需的a - b of z布局:

var table = $("#example").DataTable({
   infoCallback: function(settings, start, end, max, total, pre) {
      return start+" - "+end+' of '+max;
   }
});

将 tableinfo 移动到 table #example 的第一列:

$(".dataTables_info").detach().appendTo($("#example th:first"));

演示 -> http://jsfiddle.net/zst02x5h/