Table draw issue.
Table draw issue.

I am loading a table dynamically, I clear it, add new data, set the sort order and then draw it, as below.
var table = $('#tbl_tech_mon').DataTable();
table.clear().rows.add(data);
table.order([2, 'asc'])
table.draw();
When I do that the table does not render correctly. The header columns do not align properly.
If I manually re-sort the table by clicking a header column it fixes itself or if I call a second draw statement that also works to fix the header alignment. I don't see that I am doing anything wrong?
This question has an accepted answers - jump to answer
Answers
Call
columns.adjust()
once the table has been populated with the new data.Allan
Perfect, thanks for the super fast response!