Why scrollX cause alignment problems and is before the footer ?
Why scrollX cause alignment problems and is before the footer ?
MelodyNelson
Posts: 213Questions: 33Answers: 2
Link to test case: https://live.datatables.net/xomujosa/12
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
Hi,
I was trying horizontal scrolling on this table
https://live.datatables.net/xomujosa/12
And the result is a little « ugly » with the scrollbar or without it.
Should I change something on the table ?
Thanks
This question has an accepted answers - jump to answer
Answers
If you don't want the scrollbar to be between the footer and the header, make the table container
overflow: auto
and removescrollX
- in this case:https://live.datatables.net/xomujosa/13/edit
The reason that it is in between the body and footer by default is for when
scrollY
is activated. Then, typically, one will want the header and footer to stay in place while the body scrolls.I might look at putting in a different way of doing the scrolling when only
scrollX
is activated in future.Allan
Excellent, thank you Allan.
I tried to add a
div
before the table with theoverflow:auto
+ removing-scrollX
but the scrollbar was always showing.I didn't thought of targeting the
div
you mentionned.