我正在使用dataTables插件在表格中显示我的数据,但是当我向表格主体添加滚动条时,表格标题如下所示:
我在Datatable文档中找到了他们建议添加2行的解决方案
Hello world!
We should have written: Hello world!
That's what I get :-(
We should have written: That's what I get :-(
但是当我在javascript中添加这两行时,表格对齐看起来很糟糕。如何向数据表主体添加滚动条?
JavaScript的:
$(".dataTables_scrollHeadInner").css({"width":"100%"});
$(".table ").css({"width":"100%"});
答案 0 :(得分:0)
$(document).ready(function() {
$('#protein-table').DataTable( {
"scrollY": "400px",
"scrollCollapse": true,
"paging":false
})
});
//try this code