Table draw issue.
Table draw issue.
![tkarez](https://secure.gravatar.com/avatar/7e86c8bb7affb96b3b6325334cfa0b99/?default=https%3A%2F%2Fvanillicon.com%2F7e86c8bb7affb96b3b6325334cfa0b99_200.png&rating=g&size=120)
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!