我有一個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