Variable Table Length.
I have a requirement to display tables from Data in the CSV files. The CSV file format varies a lot - The columns and the column count as well.
Displaying this as a tables causes variable length. Sometimes exceeds the page length. Sometimes very short. Is there any way I can find the width required for each column and allocate programatically so that the total width will be something I assign.
Not very much sure if this is the right place to post this topic.
Thanks a lot.
You want to estimate how many pixels wide the table will be when a users browser renders the table?
yes, thats right. I like to calculate how many pixels each column would need.
That's a tough thing to do accurately. Font face, font size, table style, browser, operating system/installed fonts, user browser preferences(like font size) will all potentially have an effect on the final rendered size.
You could probably guess pretty closely if you went with a pixel sized monospace font, but why do you need to define the size in the first place?
An honest attempt to make the tables look uniform across the pages. Right now I have set the table width to be constant. The columns are not assigned any widths. This shows table in a not-very-much-good manner.