54 users online (0 members and 54 guests)  


  Results 1 to 8 of 8

Related

  1. Replies: 0
  2. Replies: 2
  3. Replies: 5
  4. Replies: 2
  5. Replies: 8
  1. #1
    Variable's Avatar
    New User

    Status
    Offline
    Join Date
    May 2003
    Posts
    10

    dumb tables question

    Ok, the following code works fine in mozilla, but it in explorer the two cells on the right are both at 50%...how do i make the first cell in the second column actually stay at 20px high in IE?...

    ( obviously this code is dumbed down from a much larger page - yes i know it would be easy to just put a div at the top of the second column BUT thats not an option! )

    <table width=100% bordercolor=black border=1 cellspacing=0 cellpadding=0>
    <tr>
    <td rowspan=2 bgcolor=880000 valign=top>
    test<br>test<br>test<br>test<br>test<br>
    test<br>test<br>test<br>test<br>test<br>
    </td>
    <td height=20 valign=top bgcolor=red style="height: 20px;">
    be 20 px or else
    </td>
    </tr>
    <tr>
    <td bgcolor=blue valign=top>
    be bigger than the first cell or else!
    </td>
    </tr>
    </table>

  2. #2
    krak_d's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2004
    Location
    Liverpool
    Posts
    166
    Hi,

    im using IE6. If you set the heights for the other table cells it works fine!

    krak_d

  3. #3
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732
    Hi there Variable,

    To get it to work in I.E. you will need to specify a height for both td cells ....

    css
    Code:
    <style type="text/css">
    <!--
    table {
         width:100%;
         border:solid 1px #000000;
         border-collapse:collapse;
     }
    #left {
         background:#880000;
         vertical-align:top;
     }
    #top {
          background:#ff0000;
          height:20px;
          
     }
    #bottom {
          background:#0000ff;
          height:160px;
          vertical-align:top;
     }
    //-->
    </style>
    body
    Code:
    <table><tr>
    <td id="left" rowspan="2">test<br />test<br />test<br />test
    <br />test<br />test<br />test<br />test<br />
    test<br />test</td>
    <td id="top">be 20 px or else</td>
    </tr><tr>
    <td id="bottom">be bigger than the first cell or else!</td>
    </tr></table>
    coothead

  4. #4
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732
    Hi there krak_d,

    You certainly type fast
    You weren't on the board when I started to answer this one

    coothead

  5. #5
    krak_d's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2004
    Location
    Liverpool
    Posts
    166

    Question

    Hi Coothead,

    i think there may a bug somewhere as i've noticed in the past when you have answered several questions you didn't show up as being logged in at all!

  6. #6
    Variable's Avatar
    New User

    Status
    Offline
    Join Date
    May 2003
    Posts
    10
    Ahh there is where the problem lies, the height of the second cell varies from page to page . Any way to do it without knowing the height of the second TD?

  7. #7
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    All cells in a table row will be the same height, no way around this other than the rowspan attribute which will probably not give you what you are looking for.

    Dave

  8. #8
    Variable's Avatar
    New User

    Status
    Offline
    Join Date
    May 2003
    Posts
    10
    alright, thanks guys.



Tags for this Thread