如何让html表格的高度=未设置div高度时的父div高度 [英] How to have html table's height = height of parent div when div's height is not set

查看:355
本文介绍了如何让html表格的高度=未设置div高度时的父div高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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屋!

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