Html 如何将 TextArea 放在表格 td 中?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33675114/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to put a TextArea inside a table td?
提问by Nikita Pronchik
I want to place a textarea
inside table td
. Unfortunately, it stays single-line.
我想放一个textarea
内表td
。不幸的是,它仍然是单行的。
<td align="right" valign="top">Текст акции</td>
<td>
<input type="textarea" rows="10" cols="45" name="push_title" />
</td>
If I set its width and height statically, it resizes, but still stays single-line in the middle of it. How can I solve this issue?
如果我静态设置它的宽度和高度,它会调整大小,但仍然在它的中间保持单行。我该如何解决这个问题?
回答by Satwik Nadkarny
Use the <textarea>
element instead. As such:
请改用该<textarea>
元素。像这样:
<td align="right" valign="top">Текст акции</td>
<td>
<textarea name="" id="" cols="45" rows="10"></textarea>
</td>
Just to give you an example :
只是给你一个例子:
table tr td {
border: 1px solid #ccc;
}
<table style="width:100%" cellborder="1">
<tr>
<td align="right" valign="top">Текст акции</td>
<td>
<textarea name="" id="" cols="45" rows="10"></textarea>
</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Hymanson</td>
<td>94</td>
</tr>
</table>
Hope this helps!!!
希望这可以帮助!!!