SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    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.

  2. #2
    SitePoint Wizard bronze trophy
    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?

  3. #3
    SitePoint Member
    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.

  4. #4
    SitePoint Wizard bronze trophy
    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?

  5. #5
    SitePoint Member
    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.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •