//In dtOption I am giving
.withOption('scrollY','auto')
<table datatable dt-columns="dtColumns" dt-options="dtOptions" style="width:100%;"></table>
But due to this, the header and remaining body are not in proper alignment. I tried various options but the issue is not fixed. Please suggest something what to do to fix that problem. I have attached the screenshot of the table.
答案 0 :(得分:0)
一种解决方法是:
$('#DataTableID').DataTable({
//"scrollX": true,
"initComplete": function (settings, json) {
$("#DataTableID").wrap("<div style='overflow:auto; width:100%;position:relative;'></div>");
},
});