Vertical and horizontal scrolling on wide tables - example provided

Vertical and horizontal scrolling on wide tables - example provided

jorgenjorgen Posts: 3Questions: 0Answers: 0
edited February 2013 in Bug reports
There seems to be some issues with adding both vertical and horizontal scroll to a wide table. At first only the vertical scroll is visible and table is displayed with its full width. When applying sorting by clicking one of the headers, the table gets the correct width and the horizontal scroll is visible but now the header and footer alignment is all wrong.

http://live.datatables.net/ekoxox

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    edited February 2013
    If you look at the console in your browser you'll see this warning from DataTables:

    > DataTables warning (table id = 'example'): The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation

    Basically your sScrollXInner is trying to draw the table in 110% of the table container, which is obviously not going to work. Just remove sScrollXInner and it works fine:

    http://live.datatables.net/ekoxox/2/edit

    Allan
This discussion has been closed.