如何让html表格的高度=未设置div高度时的父div高度 [英] How to have html table's height = height of parent div when div's height is not set
问题描述
我有一个html表格,在一个div里面。 div的高度基于div中的其他元素。
如何让表格的高度等于其父div的高度?
(表格高度:100%不会工作,因为div的高度未设定)
更新:我需要支持IE6,7,8,所以这些浏览器应该能够理解css的建议。
解决方案 尝试使用 position:relative
and min-height:100%;
Mb甚至 posinion:绝对
,顶部:xxx
,底部:xxx
, right:xxx
和 left:xxx
- positing和 height:auto
。
I have an html table, inside of a div. The div's height is based on other elements in the div.
How can I have the table's height be equal to its parent div's height?
(table height: 100% won't work because the div's height is not set)
Update: I need to support IE6,7,8 so the css recommendations should be understood by these browsers.
Try to use position:relative
and min-height:100%;
Mb even posinion:absolute
, top:xxx
, bottom:xxx
, right:xxx
and left:xxx
- positing and height:auto
.
这篇关于如何让html表格的高度=未设置div高度时的父div高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!