I have some data with one row of headers and one or more rows of values that I want to display. I am currently using an HTML table, but I have come across situations where I have so many columns, the table leaves the screen. Or that some column names are so long (usually just one word that emphasizes spaces), even if there aren't many, the table still exits the browser window.
I want you to be able to display all the data without scrolling horizontally. Even if it means splitting data into multiple tables.
I am currently using Embedded Perl, and one hacker solution that I used was just hardcode 8 columns per table, and if necessary, start a new table first if necessary. But ideally, I want to dynamically place as many columns as possible on one table and wrap a new row of rows / tables / if necessary.
Can this only be done with HTML / CSS? Or do I need to somehow calculate how much width each column will occupy, and base my number of columns per table on this? I do not need to use HTML tables, so if there is a better solution, I am more than ready to use it.
source
share