Page 1 of 1

Table Cell height issue

Posted: Wed Apr 18, 2007 4:44 am
by iknownothing
Hey guys,
I have a table, where there is 3 td's below each other and one larger one next to them with rowspan="3". Could anyone tell me why the individual td heights on the 3 on the side (the top 2 are specific heights, and the 3rd continues) are ignoring their specified height? The problem only occurs in IE.

Code: Select all

<tr>
     <td height="100"></td>
     <td colspan="3"></td>
</tr>
<tr>
     <td height="100"></td>
</tr>
<tr>
     <td></td>
</tr>
The IE effect would look something like this:

Code: Select all

<tr>
     <td height="250"></td> //Suposed to be 100px
     <td colspan="3"></td>
</tr>
<tr>
     <td height="130"></td>  //Suposed to be 100px
</tr>
<tr>
     <td></td>
</tr>

Posted: Wed Apr 18, 2007 10:56 am
by pickle
The table cells are probably growing because of their content. By default, table cells will a) expand to fit their contents, then b) expand to whatever size you want, provided that size isn't smaller than what's necessary for a). I've never personally needed to do this, but I believe if you use CSS & set the height as well as the "overflow" property to "hidden", it might work:

Code: Select all

.td{
   height:100px;
   overflow:hidden;
}