我有一个HTML表和小区内我有一个div如何让div占用不具有固定TD高度的html表格单元高度的100%?
<td>
<div class=content>some content</div>
</td>
<td>
<div class=content>some content<br/>some content<br/>some content<br/></div>
</td>
一些在某些细胞中的内容的多个线和div有背景色,所以我所需的视图是均匀的,所以我想内容较少的div仍然是覆盖整个td的相同高度。
我试着做
.content
{
height:100%;
}
但是这似乎并没有改变任何东西。
已[一直](http://stackoverflow.com/questions/3215553/make-a-div-fill-an-entire-table-cell)[问](HTTP:/ /stackoverflow.com/questions/3542090/how-to-make-div-fill-td-height)[several](http://stackoverflow.com/questions/18010768/make-a-div-fill-its-parent -td-height-without-specified-height-on-td)[times](http://stackoverflow.com/questions/19684509/how-do-i-make-a-div-fill-an-entire-table -cell),但是不存在纯粹的CSS解决方案。 – 2014-10-11 13:52:47
为什么不将背景颜色应用于td单元格? – 2014-10-11 14:05:00
@Mr_Green - 现在我有一个围绕div(不是TD)的边框,所以看起来很有趣,但我同意我可以绕过我的CSS并将其用作解决方案 – leora 2014-10-11 14:11:02