Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ Table not stretching downwards

Posted by: nibbler Feb 25 2007, 05:26 PM

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>

Posted by: pandy Feb 26 2007, 02:59 AM

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/http://www.quirksmode.org/css/100percheight.html

Posted by: nibbler Feb 26 2007, 05:06 PM

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.


Posted by: pandy Feb 27 2007, 03:12 AM

So what does it mess up?

Posted by: nibbler Feb 27 2007, 06:12 AM

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

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)