How can I make a text field (i.e., the <input> tag) with a width such that it fills an entire <td>?
Printable View
How can I make a text field (i.e., the <input> tag) with a width such that it fills an entire <td>?
Just a guess, try width="100%".
Didn't work.
Like I said, just a guess :) Try length="100%" (another guess).
Didn't work either. :p
width will work in the style attribute, but try using size="100%"
:)
Nope.Code:<input style="width:100%" type="text" onKeyPress="transferKeyEvent()" name="q">
Nope. :(Code:<input size="100%" type="text" onKeyPress="transferKeyEvent()" name="q">
strange, the style way works for me...
:confused:Code:<table border="1" width="100%">
<tr><TD>
<input style="width:100%" type="text">
</td><td width="5%"></td></tr>
</table>
filburt....do you test the code before you say it doesn't work??
it works for me too
Code:<form><table><tr><td style="Width:500px;"><input
style="width:100%;"></td></tr></table></form>
I'm telling you didn't work, I wouldn't lie. I'll try a more simple version in a moment...
post your code
I wasn't specifying the width of the cell which was the problem: adding the bold stuff made it work. :)
Code:<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td>
<form name="searchForm" action="http://www.google.com/search?q=site:turtletips%2Ecom+">
<br>
<script language="javascript">
<!--
function transferKeyEvent()
{
if (event.keyCode == 13)
{
event.returnValue = false;
submitSearch();
}
}
// -->
</script>
<input style="width:100%" type="text" onKeyPress="transferKeyEvent()" name="q">
</form>
</td>
<td width="75">
<div align="right"><a href="javascript:submitSearch();"><img src="searchbutton.jpg" width="70" height="27" border="0" align="absmiddle"></a></div>
</td>
</tr>
</table>