force column width in a table?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David

    force column width in a table?

    Hi,

    I want to ensure one column in a table is always the same number of pixels
    wide no matter what the screen resolution is set to on the visitors PC - the
    other two columns can wrap away top their hearts content.

    How do I do this please? The code below doesn't do it.

    <table border="1" width="100%">
    <tr>
    <td width="180" valign="top">&n bsp;</td>
    <td width="*" valign="top">&n bsp;</td>
    <td width="*" valign="top">&n bsp</td>
    </tr>
    </table>


  • Evertjan.

    #2
    Re: force column width in a table?

    David wrote on 04 jul 2003 in comp.lang.javas cript:
    [color=blue]
    > Hi,
    >
    > I want to ensure one column in a table is always the same number of
    > pixels wide no matter what the screen resolution is set to on the
    > visitors PC - the other two columns can wrap away top their hearts
    > content.
    >
    > How do I do this please? The code below doesn't do it.
    >
    > <table border="1" width="100%">
    > <tr>
    > <td width="180" valign="top">&n bsp;</td>
    > <td width="*" valign="top">&n bsp;</td>
    > <td width="*" valign="top">&n bsp</td>
    > </tr>
    > </table>[/color]

    A bit strange but it works (IE6):

    <table width="100%" border=1>
    <tr><td width="105px">
    <div style="width:10 5px;overflow:hi dden;">
    qwertyqwertyqwe rtyqwertyqwerty qwertyqwerty
    </div>
    </td><td>
    xxxxxxxxxxxxxx
    </td><tr/></table>


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • David

      #3
      Re: force column width in a table?

      [color=blue]
      > A bit strange but it works (IE6):
      >
      > <table width="100%" border=1>
      > <tr><td width="105px">
      > <div style="width:10 5px;overflow:hi dden;">
      > qwertyqwertyqwe rtyqwertyqwerty qwertyqwerty
      > </div>
      > </td><td>
      > xxxxxxxxxxxxxx
      > </td><tr/></table>[/color]


      Thanks - it's a bit of a shame as the IE page works fine, the page I'm
      working on is the one optimised for Netscape :(

      I think I'll have a rethink.

      David


      Comment

      Working...