Help - Search - Members - Calendar
Full Version: Table not stretching downwards
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
nibbler
I made a fast example because I can't display the original website yet!

http://www.nibbler.be/test.html (ofc this will be made css valid but its just an example)

the tables with 'tekst' and 'tekst2' should stretch downwards and connect with the gray line on the bottom.

can anybody help me with this?

Thanks

CODE
<table height="100%" border="1" width="50%">
    <tr>
        <td valign="top">
            <table height="100%" border="1" width="100%">
                <tr>
                    <td width="30%" bgcolor="#999999" valign="top" height="100%"><p>tekst</p><p>tekst</p><p>tekst</p><p>tekst</p><p>tekst</p></td>
                    <td valign="top" height="100%"><p>tekst2</p><p>tekst2</p><p>tekst2</p><p>tekst2</p><p>tekst2</p><p>tekst2</p></td>
                </tr>
            </table>
        </td>
        <td valign="top"><p>image</p><p>image</p><p>image</p><p>image</p><p>image</p><p>image</p><p>image</p></td>
    </tr>
    <tr>
        <td colspan="3" bgcolor="#999999" width="100%"> </td>
    </tr>
</table>
pandy
100% height on the inner table doesn't make sense (to the browser) because 100% height on the outer table doesn't make sense. As you can see the outer table isn't 100% of the viewport. For why and how, read this.
http://web.archive.org/web/20060427091047/...percheight.html
nibbler
thanks but I tried that solution and it messed up some things!

and than at the bottom of the page I read this:

QUOTE
For instance, if you want to make an element as high as the entire page (whatever this height may be) you're out of luck. Although it might seem simple the specs (and the browsers' unthinking conformance) make this completely impossible.

The spec says: "If the height of the containing block is not specified explicitly (i.e., it depends on content height), the value is interpreted like 'auto'."

This means that if you do not define any height at all for the containing block, a percentual height of any contained block doesn't work: the block becomes once again exactly as high as it needs to be.

pandy
So what does it mess up?
nibbler
woops!
I found out what I did wrong!
well, it wasn't actually messed up. it just stretches the whole outer table (green) to the bottom and that's not what I need!

he needs to stretch the table with 'tekst' and 'tekst2' (red) to the bottom of the outer table (green)

http://www.nibbler.be/test.html
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.