Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MirasMustimuly's avatar

Building complex table with html

Hello guys! I am building a complex table view. The complexity of the table is related to that the table has to have its center columns to be scrollable horizontally i.g 1st and 2nd columns are not scrollable, 3 - 10 have to be scrollable horizontally(together, not each on their own) and the rest of the columns are also not scrollable. To implement this kind of scroll behavior I am considering using divs and flexbox instead of html table tag because that kind of scrolling cannot be acheved with just html table. But that way I lose autosizing of related columns and rows provided by html table tag. So I was thinking about using simple divs and setting the same width on heading columns and row columns to imitate the same sizes, but that approach seems brittle because i have to make sure that divs in the same column have the same sizes. And also the table is really complex because it has merged cells. My question is how do you approach this kind of complex tables that have complex layout and also need horizontally scrollable parts?

0 likes
2 replies
Tray2's avatar

I would say, never ever allow horizontal scrolling on the page.

Do you really need to show everything in the table, or could you hide certain columns, and show those on click? Can the data be presented in multiple rows inside the table cell?

Table are used for tabular data and this seems to be exactly that.

Please or to participate in this conversation.