This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > July 2007 > table with height:100% doesn't take up all of parent's height?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author table with height:100% doesn't take up all of parent's height?
Jeff Bender

2007-07-05, 6:18 pm

http://people.virginia.edu/~kjl3d/testHeight.html

Why doesn't the table with id shouldBeTall have a height that is the
same as it's enclosing td? Firebug tells me that the table's height
is 25 pixels and the enclosing td's height is 300px. Do I need to
specify something different than "style=height: 100%;" ?

Ben C

2007-07-05, 6:18 pm

On 2007-07-05, Jeff Bender <jigaboophelps@XXXXXXXXXX> wrote:
> http://people.virginia.edu/~kjl3d/testHeight.html
>
> Why doesn't the table with id shouldBeTall have a height that is the
> same as it's enclosing td? Firebug tells me that the table's height
> is 25 pixels and the enclosing td's height is 300px. Do I need to
> specify something different than "style=height: 100%;" ?


You've set a percentage height of an auto-height container which the
spec tells browsers to ignore.

Although in this case you'd think it wouldn't be so hard to see what you
mean, in general the height of a container with auto height often
depends on its contents. So to ask for the contents to be some
percentage of the container is a bit circular and non-sensical.

If you set the <td> that actually contains the <table> to height: 300px
the 100% should work.
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews