IE: Table Cell Width Not Holding

I have a table that included form elements. For this one <br />
element inparticular it's value is well over 200 <br />
characters. I have a CSS class defined for the (text { width: 100%; }) <input <br />
type="text" class="text" value="" id="txtTitle" <br />
runat="Server"/> (I am using ASP.NET) when I fill the <br />
value of this text box by txtTitle.Value = myVal; it is <br />
the correct value however the width of the text box is not <br />
correct. it is 100% + some for the width of the text <br />
inside it. however if I place the value of the textbox in <br />
a hidden element and then onload for the body copy the <br />
value of the width of the textbox (txtTitle) is the <br />
correct 100% of the cell width. Is this a bug with IE or <br />
is there a way I can get around this without using the onload example?<br />
<br />
Example:<br />
<br />
<body onload="text2.value = text3.value;"><br />
<table width="300" border="1"><br />
<tr><br />
<td colspan="2">When value is in the element</td><br />
</tr><br />
<tr><br />
<td width="1%" nowrap>Title:</td><br />
<td><input type="text" style="width: 100%;" <br />
value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br />
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br />
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"></<br />
td><br />
</tr><br />
</table><br />
<table width="300" border="1"><br />
<tr><br />
<td colspan="2">Using the onload event</td><br />
</tr><br />
<tr><br />
<td width="1%" nowrap>Title:</td><br />
<td><input id="text2" type="text" style="width: 100%; <br />
value=""><input id="text3" type="hidden" <br />
value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br />
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br />
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"></<br />
td><br />
</tr><br />
</table><br />
</body><br />
</tr><br />
</table><!--content-->well my guess is that when you load the page the input with nothing in it gets set then you load something in it, hence the correct width. then the one with something in it makes the cell expand to the text before it is set.<br />
<br />
what does NS do with it?<!--content-->The problem does not occur in NS. I have only noticed it on IE 5+<!--content-->
 
Back
Top