.. been trying to fit the textbox (auto adjust the textbox width) within HTML table\'s cell but no luck.. can anyone please help? thanks
What I have:
&l
This works for me:
<asp:TextBox ID="txtPrice" runat="server" width=100%"/>
However, there is overflow to the left I'll see what I can do
set your "textbox" (whatever that is... do you mean textarea
or an input type="text"
?) to 100% width
and hight
and it's margin
to 0 and set the padding
of your table-cell to 0.
"Textboxes" like <textarea>
are inline elements. You need to make this:
HTML:
<textarea class="myTextarea">
Content
</textarea>
CSS:
.myTextarea
{
display: block;
width: 100%;
height: 100%;
}
Example for you here.
And an updated example for you here. (With margins added and a table for you to see it working in)
Also, do you have some code we can see? textbox
isn't valid HTML so we have no idea what you're trying to use :)
Try this:
<td>
<textarea style="width:100%;height:100%;margin:0;padding:0;" rows=1 cols=1>
text!
</textarea>
</td>
in my tests, it worked.
style="width: 100%; height: 100%;"
does not work?