2 Tables, same width in tds?

Discussion in 'Javascript' started by John Milton, Nov 7, 2004.

  1. John Milton

    John Milton Guest

    Hi all

    I have a table with data in it, adn the tds inside the table get their
    width automatic...

    but, i have above this table another table, and i want the tds inside
    this table to be the same size as the tds in the below table

    note that both tables in the same width, and both has same number of
    tds in a tr.

    I dont have the style.width property (it shows ""), so i tried to take
    the width from clientWidth, but when i set style.width =
    otherTable.clientWidth, the js change the value. I cant put
    clientWidth = otherTable.clientWidth cuz it's read only..

    Help please :)
    John Milton, Nov 7, 2004
    #1
    1. Advertising

  2. John Milton

    Jeff North Guest

    On 6 Nov 2004 16:36:43 -0800, in comp.lang.javascript
    (John Milton) wrote:

    >| Hi all
    >|
    >| I have a table with data in it, adn the tds inside the table get their
    >| width automatic...
    >|
    >| but, i have above this table another table, and i want the tds inside
    >| this table to be the same size as the tds in the below table
    >|
    >| note that both tables in the same width, and both has same number of
    >| tds in a tr.
    >|
    >| I dont have the style.width property (it shows ""), so i tried to take
    >| the width from clientWidth, but when i set style.width =
    >| otherTable.clientWidth, the js change the value. I cant put
    >| clientWidth = otherTable.clientWidth cuz it's read only..
    >|
    >| Help please :)


    <table width="100%" .....

    for each table.
    -------------------------------------------------------------------
    Leviticus 18:22 (KJV): "Thou shalt not lie with mankind, as with
    womankind it is abomination."

    Well, "duh!" Men don't often ask "Does this make me look fat?"
    So, of course, we don't have to lie with men like we do with women.
    -------------------------------------------------------------------
    Dionisio, 17 Jan 2004
    Jeff North, Nov 7, 2004
    #2
    1. Advertising

  3. John Milton

    RobG Guest

    John Milton wrote:

    > I dont have the style.width property (it shows ""), so i tried to take


    If you do not set the width, then the td will not have a width
    attribute. IE may be different, it sometimes assigns a value to
    properties even if you haven't.

    In general, if you want them to have the same width, you must set the
    width for each column in each tale to the same value.

    Rob.
    RobG, Nov 7, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AndrewF
    Replies:
    1
    Views:
    743
    Bruce Barker
    Oct 10, 2005
  2. Peter Bassett
    Replies:
    3
    Views:
    915
    Augustus
    Aug 15, 2003
  3. Otuatail

    Tables within tables

    Otuatail, Jul 31, 2004, in forum: HTML
    Replies:
    7
    Views:
    484
  4. btopenworld

    display records in several TDs per TR?

    btopenworld, Nov 28, 2003, in forum: ASP General
    Replies:
    3
    Views:
    121
    Aaron Bertrand [MVP]
    Nov 30, 2003
  5. bill

    Quick way to find all tds?

    bill, Feb 12, 2004, in forum: Javascript
    Replies:
    3
    Views:
    101
    Michael Winter
    Feb 12, 2004
Loading...

Share This Page