ScrollY Bug With Multirow Header

ScrollY Bug With Multirow Header

ToybToyb Posts: 19Questions: 9Answers: 1

The column sizes change when you add a second row header and are also using scrollY.

On example below:
(1) View with only "Output" selected an notice column sizes.
(2) Add scrollY: 200 and view Output again. Column sizes have changed.
(3) With scrollY still active, remove one header row and it works correctly again..

live.datatables.net/ziseroba/1/edit

How can I fix this or work around?

Thanks

Answers

  • ToybToyb Posts: 19Questions: 9Answers: 1

    Bump

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

    Hi,

    They do change a little bit, but not a huge amount for me. I'd expect them to change a bit since there needs to be space for the scrollbar (assuming whatever OS you are using displays a scrollbar - I'm using Windows 10 atm which is displaying scrollbars). I'll check again when I reboot into Linux (to get some work done ;)).

    Allan

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

    Yup - just tried Ubuntu 22.04 (Firefox) with its hidden scrollbars, and it actually looks okay to me.

    Allan

  • ToybToyb Posts: 19Questions: 9Answers: 1

    Thanks for the help Alan!

    I'm using Win10 and the latest Firefox. Notice the change in column sizes.

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

    That is certainly a bit unexpected, but is it a problem? Are you giving your users the option to switch between scrolling and not scrolling?

    Allan

  • ToybToyb Posts: 19Questions: 9Answers: 1

    No, not switching the scrolling option it will be on. I prefer the first column does not wrap unless it has to and columns such as age are sized small instead of expanded. Overall I don't think adding a second header row should change the way the table behaves. Thanks Alan.

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    Have you tried adding nowrap to the table tag. See the styleing docs for details.

    Kevin

  • ToybToyb Posts: 19Questions: 9Answers: 1

    Thanks Kevin, Yes I know I can do that but I do want it to wrap when needed. Adding a second header row just should not change anything. Thanks again!

Sign In or Register to comment.