未设置div高度时如何让html表格的高度=父div的高度

未设置div高度时如何让html表格的高度=父div的高度

问题描述:

我在div内有一个html表.div的高度基于div中的其他元素.

I have an html table, inside of a div. The div's height is based on other elements in the div.

如何使表格的高度等于其父div的高度?

How can I have the table's height be equal to its parent div's height?

(表格高度:由于未设置div的高度,所以100%无法使用)

(table height: 100% won't work because the div's height is not set)

更新:我需要支持IE6、7、8,因此这些浏览器应该可以理解css的建议.

Update: I need to support IE6,7,8 so the css recommendations should be understood by these browsers.

尝试使用 position:relative min-height:100%;

Mb甚至 posinion:absolute top:xxx bottom:xxx right:xxx left:xxx -定位和 height:auto .

Mb even posinion:absolute, top:xxx, bottom:xxx, right:xxx and left:xxx - positing and height:auto.