Enabling scrollY only displays horizontal scroll and headers don't move horizontally

Enabling scrollY only displays horizontal scroll and headers don't move horizontally

kthorngrenkthorngren Posts: 21,315Questions: 26Answers: 4,948
edited October 2022 in DataTables 1.10

Not sure if this has been asked before. When enabling only scrollY on a table that doesn't fit the container a horizontal scroll bar is presented and the headers don't scroll horizontally. Test Case:
http://live.datatables.net/minuqixe/1/edit

The problem can also be seen with the examples in this thread.

Kevin

Replies

  • allanallan Posts: 63,488Questions: 1Answers: 10,467 Site admin

    Yeah, that's something I'm aware of, but I haven't quite decided how to handle yet. Add scrollX: true and it is resolved. The problem is that horizontal scroll hasn't been enabled, so DataTables doesn't attempt to do anything about keeping the header and body insync. It could be that if scrollY is enabled then scrollX is automatically enabled. That's my best idea at the moment unless yourself or anyone else has any ideas?

    Allan

  • kthorngrenkthorngren Posts: 21,315Questions: 26Answers: 4,948

    The only comment I have is if you automatically enable scrollX then make sure its documented as it might not be expected or wanted unless specifically enabled. I usually don't use the scrolling features so I have opinion one way or the other.

    Kevin

Sign In or Register to comment.