Results 1 to 2 of 2

Thread: Determining Table Column width?

  1. #1
    Join Date
    May 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Determining Table Column width?

    I have a little bit of an issue. I was trying to make a scrollable table that worked in IE and Firefox but no matter how many examples from the web I tried it just wasn't working in my application. So I went to another plan. The titles of the columns will be in a separate table than the data.

    <table>
    <tr><td>Column 1</td></tr>
    ...

    </table>

    <table>
    <tr></td>data</td></tr>
    ...
    </table>

    The data is populated into the tables from a database. The widths of the columns are not set initially - so the table gets filled with data and the widths are natural based on the data.

    My problem is that I need the columns of the table containing the column headers to be the same as the column widths in the table containing the data. So is there a way in javascript I can do this? I would have to find out what the width is of the table with the data and then set the width of the columns containing the header.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I don't think so, no. You can try specifying the sizes in ems, but I don't know if ems applied to block elements remain in proportion to the default font size. John?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •