ScrollY Bug With Multirow Header

ScrollY Bug With Multirow Header

ToybToyb Posts: 16Questions: 7Answers: 0

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: 16Questions: 7Answers: 0

    Bump

  • allanallan Posts: 57,265Questions: 1Answers: 9,123 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: 57,265Questions: 1Answers: 9,123 Site admin

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

    Allan

  • ToybToyb Posts: 16Questions: 7Answers: 0

    Thanks for the help Alan!

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

  • allanallan Posts: 57,265Questions: 1Answers: 9,123 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: 16Questions: 7Answers: 0

    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: 17,273Questions: 25Answers: 4,102

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

    Kevin

  • ToybToyb Posts: 16Questions: 7Answers: 0

    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.