使< textarea>填写表格单元格的高度 [英] Make <textarea> fill table cell's height

查看:62
本文介绍了使< textarea>填写表格单元格的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码创建带有图像和< textare> 的表格:

I use the following code to create a table with an image and a <textare>:

<table border="1" style="border-color: #a6a6a6" cellpadding="4" cellspacing="0" width="702">\
  <col width="455">
  <col width="230">\
  <tbody>
    <tr>\
      <td type="image" id="' + sdfsdsdf + '" data-parent-id="0" data-type="NORMAL" data-img="1" data-flags="1" data-type-ios="3" height="85" width="455"><img src="http://www.whichcitytotravel.com/wp-content/uploads/2016/01/Sunset-in-Monaco.jpg" style="width:100%;"></td>\
      <td width="230">
        <pre><textarea id="' + sdfsdfsdaf + '" data-parent-id="' + id_picture + '" data-type="sdfsdafsd" data-type-ios="4" rows="5" style="width:100%; height:100%; display:block;"></textarea></pre><br></td>\
    </tr>
  </tbody>
</table>'

结果看起来像这样: https://jsfiddle.net/705buxgz/

我希望< textarea> 填充表格单元格中所有可用的高度.

I'd like the <textarea> to fill all the height available inside the cell of the table.

我在这里尝试了所有其他答案,但没有一个对我有用.

I tried all the other answers here and none of them worked for me.

推荐答案

这应该可以解决问题: https://jsfiddle.net/cLro4q10/

This should do the trick: https://jsfiddle.net/cLro4q10/

您必须设置表格 pre 高度.在这种情况下,我做到了100%.如果已设置父母的身高,则孩子只能是其父母身高的100%.

You have to set the table and pre height. In this case I made it 100%. A child can only be 100% height of its parent if the parents' height has been set.

这篇关于使&lt; textarea&gt;填写表格单元格的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆