<td width=...> in IE

Discussion in 'HTML' started by jodleren, Oct 23, 2007.

  1. jodleren

    jodleren Guest

    Hi!

    I have problems with the following code in IE, but it works well in
    Firefix.

    <table border=1>
    <tr>
    <td>a b</td>
    <td width=25>c</td>
    </tr>
    <tr>
    <td colspan=2>The red fox jumped over the lazy dog</td>
    </tr>
    </table>

    Idea: the top row, cell 1 - as wide as possible, cell 2, specified
    width - (or as short as possbile if that can help. Setting cell one
    just to take up all remaining space is ok too)
    IE cannot handle this. Any suggestions?

    WBR
    Sonnich
     
    jodleren, Oct 23, 2007
    #1
    1. Advertising

  2. Scripsit jodleren:

    > I have problems with the following code in IE, but it works well in
    > Firefix.
    >
    > <table border=1>
    > <tr>
    > <td>a b</td>
    > <td width=25>c</td>
    > </tr>
    > <tr>
    > <td colspan=2>The red fox jumped over the lazy dog</td>
    > </tr>
    > </table>


    In a <td> element, the width attribute specifies (by HTML specs) the
    suggested minimum width, so both IE and Firefox behave by the specs, just
    differentöy.

    > Idea: the top row, cell 1 - as wide as possible, cell 2, specified
    > width - (or as short as possbile if that can help. Setting cell one
    > just to take up all remaining space is ok too)
    > IE cannot handle this. Any suggestions?


    Use <table style="table-layout: fixed">. This effectively sets, as a side
    effect, the total width of the table to 100%, but this seems to be what you
    want.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Oct 23, 2007
    #2
    1. Advertising

  3. On Oct 23, 11:05 am, "Jukka K. Korpela" <> wrote:
    > Scripsit jodleren:
    >
    > > I have problems with the following code in IE, but it works well in
    > > Firefix.

    >
    > > <table border=1>
    > > <tr>
    > > <td>a b</td>
    > > <td width=25>c</td>
    > > </tr>
    > > <tr>
    > > <td colspan=2>The red fox jumped over the lazy dog</td>
    > > </tr>
    > > </table>

    >
    > In a <td> element, the width attribute specifies (by HTML specs) the
    > suggested minimum width, so both IE and Firefox behave by the specs, just
    > differentöy.
    >
    > > Idea: the top row, cell 1 - as wide as possible, cell 2, specified
    > > width - (or as short as possbile if that can help. Setting cell one
    > > just to take up all remaining space is ok too)
    > > IE cannot handle this. Any suggestions?

    >
    > Use <table style="table-layout: fixed">. This effectively sets, as a side
    > effect, the total width of the table to 100%, but this seems to be what you
    > want.


    Thank you that explains it. The solution is is ok, but requieres
    nested tables to have the same. I'll play around with it to see what
    is possbile here.
    Other ideas still welcome.

    Thanks
    Sonnich
     
    Sonnich Jensen, Oct 23, 2007
    #3
  4. Scripsit Sonnich Jensen:

    [a fullquote, the usual way of indicating lack of comprehensive readins ]

    > Thank you that explains it.


    Which "that" explains "it"? (Please don't answer. This was a rhetoric
    question.)

    > The solution is is ok,


    It depends on what the problem really is. It wasn't explained, so I decided
    to answer just the question that was asked.

    > but requieres nested tables to have the same.


    Same what? What should have the same what and why? And why would you need
    nested tables? Any "solution" that requires nested tables is a non-solution,
    often to a non-problem.

    > Other ideas still welcome.


    How about telling the real problem, demonstrating it with a URL, and using
    consistently your real name, if you were the original poster?

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Oct 23, 2007
    #4
  5. jodleren

    richard Guest

    On Oct 23, 2:23 am, jodleren <> wrote:
    > Hi!
    >
    > I have problems with the following code in IE, but it works well in
    > Firefix.
    >
    > <table border=1>
    > <tr>
    > <td>a b</td>
    > <td width=25>c</td>
    > </tr>
    > <tr>
    > <td colspan=2>The red fox jumped over the lazy dog</td>
    > </tr>
    > </table>
    >
    > Idea: the top row, cell 1 - as wide as possible, cell 2, specified
    > width - (or as short as possbile if that can help. Setting cell one
    > just to take up all remaining space is ok too)
    > IE cannot handle this. Any suggestions?
    >
    > WBR
    > Sonnich



    width=25? 25 what? Pixels or percent?
    width="25" equals pixels where as "25%" defines percent.

    First, you would need to define width in the table tag.
    <table width="100">
    Otherwise it assumes 100%.
    Defining the width of only one cell would play havoc on the others as
    data changes within them.
    Define the first as say "50" then the second as "25", leaving the 3rd
    to use what ever is left.
    At least this way the cells would keep some sort of order in them.
     
    richard, Oct 24, 2007
    #5
  6. richard wrote:
    > On Oct 23, 2:23 am, jodleren <> wrote:
    >> Hi!
    >>
    >> I have problems with the following code in IE, but it works well in
    >> Firefix.
    >>
    >> <table border=1>
    >> <tr>
    >> <td>a b</td>
    >> <td width=25>c</td>


    >
    >
    > width=25? 25 what? Pixels or percent?
    > width="25" equals pixels where as "25%" defines percent.


    It would be pixels. The HTML attribute is in pixels unless you
    explicitly use the "%" unit identifier width="25%" T think you are
    confusing it with CSS properties where unit identifiers are required[1]
    for length values, width: 25px;

    [1]optional for "0" values and with line-height property.



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Oct 24, 2007
    #6
    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:
    790
    Bruce Barker
    Oct 10, 2005
  2. Xu
    Replies:
    11
    Views:
    8,578
    Andrew Thompson
    Jul 16, 2005
  3. Sean Jorden
    Replies:
    1
    Views:
    604
    laurie
    Aug 19, 2003
  4. kris
    Replies:
    11
    Views:
    880
  5. Paul Furman

    min-width max-width again

    Paul Furman, Feb 9, 2004, in forum: HTML
    Replies:
    10
    Views:
    712
    Beauregard T. Shagnasty
    Feb 9, 2004
Loading...

Share This Page