Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have html table's height = height of parent div when div's height is not set

Tags:

html

css

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.

like image 316
Tony_Henrich Avatar asked Apr 13 '10 19:04

Tony_Henrich


1 Answers

Nearly impossible, because the renderer cannot know how much 100% should be.

A really dirty workaround: Add display:table to the div and display:table-row-group to the table. Don’t expect too much … :)

like image 125
fuxia Avatar answered Oct 22 '22 18:10

fuxia