Hi,
Following is a simple html which has a table with one "<tr>" and two "<td>". Both the "<td>"s have a fixed width of "150px". In one "<td>" I have put some long text, while in the second "<td>" I have an input box of type text which is a style width of "98%" and the same long text as in first "<td>".
Code:
<HTML>
<BODY>
<TABLE border="1" width="300px">
<TR>
<td id="1" width="150px">
asdf sdafasdf sadf sadfasdfasdf sdafasdf sadf sadfasdfasdf sdafasdf sadf sadfasdfasdf sdafas
</td>
<TD width="150px">
<input type="text" style="width:98 %;border:1px solid red;" value ="asdf sdafasdf sadf sadfasdfasdf sdafasdf sadf sadfasdfasdf sdafasdf sadf sadfasdfasdf sdafas"/>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
PROBLEM:
Why is the second "<td>" having a strangely big size event when I have fixed its width to be "150px"? Same works fine when the value of the "<input>" is reduced to fewer chars. The widht of the second "<td>" is directly proportional to the lenght of the text on the input text box inside it, why?
Following is a simple html which has a table with one "<tr>" and two "<td>". Both the "<td>"s have a fixed width of "150px". In one "<td>" I have put some long text, while in the second "<td>" I have an input box of type text which is a style width of "98%" and the same long text as in first "<td>".
Code:
<HTML>
<BODY>
<TABLE border="1" width="300px">
<TR>
<td id="1" width="150px">
asdf sdafasdf sadf sadfasdfasdf sdafasdf sadf sadfasdfasdf sdafasdf sadf sadfasdfasdf sdafas
</td>
<TD width="150px">
<input type="text" style="width:98 %;border:1px solid red;" value ="asdf sdafasdf sadf sadfasdfasdf sdafasdf sadf sadfasdfasdf sdafasdf sadf sadfasdfasdf sdafas"/>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
PROBLEM:
Why is the second "<td>" having a strangely big size event when I have fixed its width to be "150px"? Same works fine when the value of the "<input>" is reduced to fewer chars. The widht of the second "<td>" is directly proportional to the lenght of the text on the input text box inside it, why?
Comment