在数据表插件中,虽然我正在调整大尺寸(宽度)的任何列的大小,但我想保存列的宽度并仅在宽度大于某些时启用水平滚动value(这个值由我定义)。
而现在它相对调整其他列并在100%固定。
有人可以帮忙吗?
// all task view table generation script
var allTaskTable;
allTaskTable = $('#AllTaskTable').dataTable({
"fnDrawCallback": function (AllTaskSettings) {
if (AllTaskSettings.aiDisplay.length == 0) {
return;
}
}, "sPaginationType": "full_numbers",
"sDom": 'Rlr<"tableContainer"t>ip',
"aaSorting": [[9, "asc"]],//Default sorting is on column 9, desc
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [0, 1] }//Do not sort on column 0 and 1, which are the radio button and context menu
],
"bRetrieve": true,
"bDestroy": true,
"bPaginate": true, // this line of code for header freeze
//"bFilter": true,
//"sScrollY": "580",
//"sScrollX": "100%",
//"sScrollXInner": "100%",
//"bScrollCollapse": true
"autoWidth": false
});
答案 0 :(得分:0)
"scrollY": "200px",
"scrollCollapse": true,
链接: https://datatables.net/examples/api/tabs_and_scrolling.html
希望这就是你要找的东西