Table draw issue.

Table draw issue.

tkareztkarez Posts: 2Questions: 1Answers: 0

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.order([2, 'asc'])

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


  • allanallan Posts: 59,799Questions: 1Answers: 9,682 Site admin
    Answer ✓

    Call columns.adjust() once the table has been populated with the new data.


  • tkareztkarez Posts: 2Questions: 1Answers: 0

    Perfect, thanks for the super fast response!

Sign In or Register to comment.