Forum Moderators: open

Message Too Old, No Replies

Keeping the bottom table cell a constant width

         

walkman

11:00 pm on Apr 20, 2005 (gmt 0)



this is weird. I can't get this to work. Tried td width, tables inside etc. No luck.
Is it possible to make the "bottom cell I" to stay at the same width, no matter what the top cells do? I've tried everything and when the text on top on is too large (it varies, somewhat random), the bottom cells are are messed up to. Is is possible to do this without a spacer gif?

<table border="1" width="98%">
<tr>
<td rowspan="2">logo.gif</td>
<td>top cell I /blank space</td>
<td>top cell II /some text</td>
</tr>
<tr>
<td>bottom cell I /nav menu</td>
<td>bottom cell II / a few images</td>
</tr>
</table>

thanks in advance,

tbear

11:29 pm on Apr 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just a guess, try giving the cell a percentage width (to keep flexible sizing), such as <td width="30%">.
You may well find, that if the images, in bottom cell II, are wider than the remaining percentage width, that they take priority.
Other than that I would split the table into two tables.
Please don't cuss me for not suggesting CSS positioning.....

lammert

6:51 am on Apr 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Maybe this works:

<table border="1" width="98%">
<tr>
<td rowspan="2">logo.gif</td>
<td colspan="2">top cell I /blank space</td>
<td>top cell II /some text</td>
</tr>
<tr>
<td width="200">bottom cell I /nav menu</td>
<td colspan="2">bottom cell II / a few images</td>
</tr>
</table>

<added>
Explanation:
The table is divided in three columns. The first column has a fixed width. The boundary between the second and third column is flexible depening of the size of the text in your top cell II. This won't affect the contents of your second row, because bottom cell II spans across both columns.

Second method:

<table border="1" width="98%">
<tr>
<td rowspan="2">logo.gif</td>
<td colspan="2" align="right">top cell II /some text</td>
</tr>
<tr>
<td width="200">bottom cell I /nav menu</td>
<td>bottom cell II / a few images</td>
</tr>
</table>

In this case the empty cell is deleted and the text in top cell II can span the whole table width. I added a right align to keep the text at the proper location.

Which solution you choose depends on the maximum length of the text in top cell II. You can experiment with both examples to see which gives best results for your situation.

</added>

walkman

2:19 pm on Apr 21, 2005 (gmt 0)



thank you guys,
used the second suggestion from lammert and it worked. Thanks again.