SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: Variable Table Length.
-
Apr 24, 2009, 21:27 #1
- Join Date
- Dec 2008
- Posts
- 9
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Apr 24, 2009, 22:00 #2
- Join Date
- Jul 2008
- Posts
- 5,757
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You want to estimate how many pixels wide the table will be when a users browser renders the table?
-
Apr 24, 2009, 22:13 #3
- Join Date
- Dec 2008
- Posts
- 9
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yes, thats right. I like to calculate how many pixels each column would need.
-
Apr 24, 2009, 22:22 #4
- Join Date
- Jul 2008
- Posts
- 5,757
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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?
-
Apr 24, 2009, 22:35 #5
- Join Date
- Dec 2008
- Posts
- 9
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
Bookmarks