Table header is not resizing when sidebar is hidden

Table header is not resizing when sidebar is hidden

MinhTranMinhTran Posts: 13Questions: 3Answers: 0

Link to test case: https://live.datatables.net/fizuwupi/9/
Debugger code (debug.datatables.net): eyutip
Error messages shown: none
Description of problem:

Link video demo: https://drive.google.com/file/d/1jXIYkFXBXj19c3FLOXa9FMgLBsN5xpBT/view?usp=drive_link

The colvis button work correct with have no sidebar. but with sidebar hidden/show, table do not adjust column width. I remember saw a docs this case fixed on new version. I don't know this is a bug or not. I have to use table.columns.adjust() to work correctly

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I have to use table.columns.adjust() to work correctly

    Yes, that is correct and expected. DataTables does not "watch" the rest of the document for changes, so if something happens that causes the table to resize, then yes, you need to call columns.adjust().

    Allan

  • MinhTranMinhTran Posts: 13Questions: 3Answers: 0

    thank you Allan

Sign In or Register to comment.