表格单元格中的文本区域宽度和高度不会更改

时间:2016-05-20 20:39:38

标签: php html css

我有这个脚本,并尝试更改文本区域的宽度和高度,但运行代码时没有变化。

这是我的代码:

<td style="width:200; height:400" width="200"> 
    <textarea name="teamnews_text" size="300" cols="32" class="form-control">
       <?php echo htmlentities($row_all_players['playerNews_text'], ENT_COMPAT, 'utf-8'); ?>
    </textarea>
</td>

3 个答案:

答案 0 :(得分:1)

textarea不遵循正常的大小调整规则。

尝试添加此css:

box-sizing: border-box

答案 1 :(得分:1)

Textarea中的

使用rows(非尺寸)和cols作为属性,或使用widthheight作为样式。

答案 2 :(得分:1)

试用此代码 - 希望它能为您效用

<td style="width:200; height:400" width="200" > 
<textarea name="teamnews_text" class="custom">
   <?php echo htmlentities($row_all_players['playerNews_text'], ENT_COMPAT, 'utf-8'); ?>
</textarea>
</td>


<style type="text/css">
.custom{
    width: 100%;
    height: 100%;
}
</style>