Fixed columns break on scrollX

Fixed columns break on scrollX

zexelonzexelon Posts: 2Questions: 1Answers: 0

We are having an odd issue with fixed columns breaking when using any value of scrollX:.

This test case is a blatant copy of another issue, but its exactly what we are running into: https://live.datatables.net/xoqimupu/1/

When we set scrollX: true or scrollX: '800px' or any value, the sticky columns no longer stay pinned.

This is happening in all versions of datatables that we have including the latest version just downloaded.

Answers

  • allanallan Posts: 63,700Questions: 1Answers: 10,501 Site admin
    div.dataTables_wrapper {
      width: 800px;
      margin: 0 auto;
    }
    

    That is forcing the div container for the table to be 800px. At that width the window needs to scroll, but the DataTable does not.

    Remove that and set the white space for the table cells to not wrap and it works as expected: https://live.datatables.net/xoqimupu/2/edit

    Allan

Sign In or Register to comment.