I have some data with one row of headers and one or more rows of values that I want to display. Currently, I'm using an HTML table, but I've come across situations where I have so many columns, the table goes off the end of the screen. Or that some column names are so long (they're usually just a single word that have underscores as spaces), even if there aren't that many columns, the table still goes off the end of the browser window.
What I want is to be able to display all data without having to scroll horizontally. Even if that means breaking the data up into multiple tables.
I'm currently using Embedded Perl, and one hackish solution I've used is to just hardcode 8 columns per table, and start a new table under the first if necessary. But ideally, what I want is to dynamically put as many columns as possible on one table, and wrap to a new line of rows/tables/whatever if necessary.
Can this be done HTML/CSS-only? Or do I need to somehow calculate how much width each column will take, and base my number of columns per table on that? I don't have to use HTML tables, so if there's a better solution, I'm more than willing to use it.