1
我想設置數據表列寬度。請參閱下面的代碼。如何調整數據表列寬
$('#datatable5').DataTable({
"order" : [ [ 0, "desc" ] ],
"columnDefs": [ { "width": "100px", "target":0 }, { "width": "400px", "target":1 }, { "width": "200px", "target":2 } ,{ "width": "200px", "target":3 } ,{ "width": "200px", "target":4 } ,{ "width": "200px", "target":5 } ,{ "width": "200px", "target":6 }, { "width": "200px" , "target":7 }, { "width": "200px", "target":8 }, { "width": "200px", "target":9 }],
//"sPaginationType" : "bs_two_button",
//"iDisplayLength" : 9,
"scrollX": true,
// "sScrollX" : "100%",
"paging": true,
"sPaginationType" : "bs_two_button",
"info" : false,
"fnDrawCallback" : function(oSettings) {
$('td').removeClass('sorting_1');
}
});
如何將列寬顯式傳遞給數據表?我試着用CSS來設置表格的寬度。但是,這不是成功?