Forum Moderators: open

Message Too Old, No Replies

Middle Table Cell that stretches

         

dvduval

9:25 pm on Dec 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I want to set up a page 4 rows on the left and right sides that are about 150 pixels wide (and cannot stretch). So basically, I'll have 4 square blocks on each side. There will be 3 columns, the blocks on each side, and a middle column. I want the middle column to strtch to fit the screen size. Any pointers?

aek

9:35 pm on Dec 5, 2002 (gmt 0)

10+ Year Member



Set the table to 100% width. Then set the left and right column widths i.e <TD width="150"> the middle column should then stretch to fit the screen. As below:

<table width="100%">
<tr>
<td width="150">Left</td>
<td>&nbsp;</td>
<td width="150">Right</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>

SuzyUK

10:03 pm on Dec 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



as an extra to aek's post, which is quite right, but presuming you want the centre column to stretch vertically as well as horizontal, you would then need to add the "row span" and the alignment eg:

<table border="1" cellpadding="2" cellspacing="0" width="100%">
<tr>
<td width="150">left1</td>
<td rowspan="4" valign="top">center column, all center content in this cell....</td>
<td width="150">right1</td>
</tr>
<tr>
<td width="150">left2</td>
<td width="150">right2</td>
</tr>
<tr>
<td width="150">left3</td>
<td width="150">right3</td>
</tr>
<tr>
<td width="150">left4</td>
<td width="150">right4</td>
</tr>
</table>

Suzy