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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Including a Text Box in a Table's Cell

Status
Not open for further replies.

fmh

Technical User
Jan 19, 2003
4
US

When I build tables in HTML, I always prefre to use relative (percentage) widths, for the whole tabel and for its cells. One problem I faced - using the IE - is that when I build a table this way and include a text box within
a cell, such that the width of the text box is set to 100% so that it takes the whole cell's width, when I do so, that cell gets wider if not the whole content - specified at design time - of the text box can be displayed at once. For clarification, here is an example:

<TABLE BORDER=&quot;1&quot; WIDTH=&quot;50%&quot; CELLSPACING=&quot;0&quot;>
<TR>
<TH WIDTH=&quot;30%&quot;>Type</TH>
<TH WIDTH=&quot;70%&quot;>Comment</TH>
</TR>

<TR>
<TD>Whatever</TD>
<TD><INPUT TYPE=&quot;TEXT&quot; VALUE=&quot;Try putting a short and a
long string here to observe the problem&quot;
STYLE=&quot;width: 100%&quot;></TD>
</TR>
</TABLE>

Any help (soultions or alternatives) is highly appreciable.

 
i don't see any other solution than truncating your string so the max length is shorter thant the cell lenght
but it's not elegant at all !!
 
Use cellpadding=8 . This is the distance of content to the cell borders.
-----G.Hoffmann
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top