Forum Moderators: not2easy

Message Too Old, No Replies

Make div fill entire table cell vertically in strict mode?

height: 100% doesn't work

         

sergekh

10:28 am on Jun 16, 2007 (gmt 0)

10+ Year Member



Basically I'm stuck with the same problem as this thread:
[webmasterworld.com...]

I need to get layout like this:
1) outer table with 2 cells
2) left cell contains large image
3) right cell contains inner table with 3 rows
4) inner table should be stretched vertically to be the same size as the large image

BIG CELL ¦ top line
BIG CELL ¦ empty filler
BIG CELL ¦ bottom line
(i.e. to stretch right side to the size of the left side)

but even with height 100% on inner table I get something like this:
BIG CELL ¦ top line
BIG CELL ¦ bottom line
BIG CELL ¦

unless I set height of the outer table explicitly.
In quirks mode it works fine, in strict - fails.
Is it doable with CSS at all?

Xapti

4:13 am on Jun 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



100% height will not work unless one of it's parent or one of it's ancestors has a height specified. If you want the main table to be the full height of the window and then have the nested table the same height as the other cell, the following may work:

html,body{height:100%}
outertable{height:100%}
innertable{height:100%}

I think that all padding, margin and borders have to be 0 for this to work effectively.