现在是横竖都能滚动,上下滚动的时候表头不固定,求大神解决啊
如果您想要让导航栏固定在页面的顶部,请向 .navbar class 添加 class .navbar-fixed-top
不知道是这个意思吗
类似于这种,上面的是表头,现在左右滑动的时候表头是动的,上下滑动现在也是动的,怎么才能上下滑动的时候表头不动呢
dataTables.appendChild(dataTables_head);
dataTables.appendChild(dataTables_boby);
$('#LinuxDataTable').DataTable( {
"destroy": true,
scrollY: 300,
scrollX: true,
scrollCollapse: true,
bPaginate: true,
"aLengthMenu": [[-1, 200, 100,50], ["ALL", 200, 100,50]],
bLengthChange: true,
"bAutoWidth": true,
"aaSorting": [],
"oLanguage": {
"sProcessing": "正在加载中......",
"sZeroRecords": "对不起,查询不到相关数据!",
"sEmptyTable": "表中无数据存在!",
"sInfo":"显示第_START_ 至_END_ 项结果,共_TOTAL_ 项",
"sInfoFiltered":"从_MAX_条记录中搜索",
"sSearch": "搜索",
"oPaginate": {
"sFirst": "首页",
"sLast": "尾页",
"sNext": "下一页",
"sPrevious": "上一页"
}
}
我这里区分了head和body,拼接起来的可以达到你要的这个效果
#if> |
</div>
表头固定是表头悬浮在页面上吗?如果是那就给表头加 position:fixed;
事情紧急啊,大神求救啊,快快快