为什么这个textarea不会超过四个cols? [英] Why does this textarea not expand over four cols?
问题描述
我希望我的textarea扩展到四个HtmlTable列,但它仅限于这些列中的第一列。
看似相同的代码适用于标签(它扩展到四个cols,以它们为中心)。
我希望我可以在这里粘贴一个尖叫声,但相反会试着用1000个字,描述它:
评论标签/文字显示在四列中心
textarea仅出现在前1 /第4个单元格。
所以这里是评论的代码,看起来像我想要的那样:
< td colspan = 4 class = nobordercell centertext > < 标签 > 评论< / label > < / td >
...这里是textarea的代码,它看起来并不像我想要的那样:
< td colspan = 4 > < input colspan = 4 type = textarea
name = airfareComments id = airfareComments title = to / from class = lightsteelblue / > < / td >
我在td上用colspan =4在textarea上尝试了它,如上所示,两者都是如此;没关系 - 它都不起作用。
我需要更改什么?
你犯了很多错误。
-输入
没有colspan
属性。
- 没有textarea输入类型
- 你还没有使用造型
< 风格 >
td {border:1px solid red;宽度:100px;高度:50px; text-align:center;}
< / style >
< table >
< tr < span class =code-keyword>>
< td > 1 < / td < span class =code-keyword>> < td > 2 < / td > < td & gt; 3 < / td > ; < td > 4 < / td > < td > 5 < span class =code-keyword>< / td >
< / tr >
< tr >
< td < span class =code-attr ibute> colspan = 4 > < 输入 类型 = text style = 宽度:100% > < / td > < td > 5 < / td >
< / TR >
< tr >
< td colspan = 4 > < < span class =code-leadattribute> textarea style = width:100% > < / textarea > < / td > & td > 5 < / td >
< / tr >
< / table >
I want my textarea to expand over four HtmlTable columns, but it restricts itself to the first of these columns only.
Seemingly the same code works for a label (it expands across the four cols, centering itself in them).
I wish I could paste a scream shot here, but will instead try to, in 1,000 words, describe it:
The Comment label/text appears centered within the four columns
The textarea appears only in the first 1/4th of the cell.
So here's the code for Comments, which looks as I want it to:
<td colspan="4" class="nobordercell centertext"><label>Comments</label></td>
...and here is the code for the textarea, which doesn't look as I want it to:
<td colspan="4"><input colspan="4" type="textarea"
name="airfareComments" id="airfareComments" title="to/from" class="lightsteelblue"/></td>
I tried it with "colspan="4"" on the td, on the textarea and, as shown above, in both; it doesn't matter - none of it works.
What do I need to change?
You have made many-many mistakes.
-input
has nocolspan
property.
- there is no textarea input type
- you haven't used styling
<style> td {border: 1px solid red; width: 100px; height:50px;text-align:center;} </style> <table> <tr> <td>1</td><td>2</td><td>3</td><td>4</td><td>5</td> </tr> <tr> <td colspan="4"><input type="text" style="width:100%"></td><td>5</td> </tr> <tr> <td colspan="4"><textarea style="width:100%"></textarea></td><td>5</td> </tr> </table>
这篇关于为什么这个textarea不会超过四个cols?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!