Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To get textarea to fill <td> 1

Status
Not open for further replies.

bigoldbulldog

Programmer
Feb 26, 2002
286
US
Hi -

Does anyone know of a way to get a form textarea to completely fill the width of a <td> element? The table is already (partially) arranged using CSS and percentages for widths.

Ultimately I want the textarea to fill the <td> element and not change the rendered width (expand) of the td.

Thank you very much Cheers,
ND [smile]

bigoldbulldog@hotmail.com
 
Hi ND,

I don't know exactly how you specified the table/td dimensions but here is an example where I set the width and height of the left-upper cell:

<table bgcolor=&quot;yellow&quot; width=400 height=300 border=2 cellspacing=4 cellpadding=0>
<form name=form1>
<tr >
<td bgcolor=&quot;red&quot; width=&quot;20%&quot; height=&quot;20%&quot;>&nbsp;</td>
<td width=&quot;80%&quot; bgcolor=&quot;orange&quot;>&nbsp;</td>
</tr>
<tr>
<td bgcolor=&quot;green&quot;>&nbsp;</td>
<td bgcolor=&quot;purple&quot;><textarea style=&quot;width:100%; height:100%;&quot; name=ta1></textarea></td>
</tr>
</form>
</table>

Now if you change the width/height of the left-upper cell, the textarea keeps the maximum right-down cell dimensions

<table bgcolor=&quot;yellow&quot; width=400 height=300 border=2 cellspacing=4 cellpadding=0>
<form name=form1>
<tr >
<td bgcolor=&quot;red&quot; width=&quot;50%&quot; height=&quot;50%&quot;>&nbsp;</td>
<td width=&quot;80%&quot; bgcolor=&quot;orange&quot;>&nbsp;</td>
</tr>
<tr>
<td bgcolor=&quot;green&quot;>&nbsp;</td>
<td bgcolor=&quot;purple&quot;><textarea style=&quot;width:100%; height:100%;&quot; name=ta1></textarea></td>
</tr>
</form>
</table>

Keep in mind that the (table) cellpadding=0 and see the difference when you change it to a value > 0

I tested it in IE4.0 and IE5.5
It won't work in NN4.7 (I can't test NN6 here)

Hope this helps,
Erik
<!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top