Misalignment in column header and body from second time onwards on draw
Misalignment in column header and body from second time onwards on draw
Hi,
First time I populate data in datatable header and bosy is properly aligned. On click of button I reload data to the table. The table header and body is not aligned. Only first time it comes properly.
Table initialisation
if ( $.fn.dataTable.isDataTable('#tblData') ) {
$('#tblData').DataTable().clear();
//$('#tblData').DataTable().draw();
$('#tblData').DataTable().rows.add(tableData).draw();
} else {
$('#tblData').DataTable({
retrieve : true,
"columnDefs" : [ {
className : "dt-body-center"
} ],
"processing" : true,
"scrollX" : true,
"scrollY" : true,
"data" : tableData,
}
What can be the possible issue and how to solve it. Please help.
Answers
You posted this question earlier today:
https://datatables.net/forums/discussion/43668/table-header-and-body-misalignement#latest
Please only post your questions once.
You can try
columns.adjust()
. If that doesn't help please provide a link to a pgae showing the issue.Kevin