简体   繁体   中英

Why is my right aligned table not showing up with 100% height in browser?

I am making this web page and I want the table on the right to have 100% height, yet when I view it in the browser, it isn't maximized vertically. You can view it here:

http://wpiix10.x10.mx/ifoot8.htm

See the pink background table on the right side? It should be 100% of the web page's height yet it's small.

Here's the code I'm using:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%" bgcolor="#C0C0C0" style="position: absolute; left: 0; bottom: 0">
    <tr>
        <td>
        <table border="0" width="100%" cellspacing="0" cellpadding="0" style="position: absolute; bottom: 0" bgcolor="#00FF00" height="23" bordercolor="#FFFFFF">
            <!-- MSTableType="nolayout" -->
            <tr>
                <td>&nbsp;</td>
            </tr>
        </table>
        <div align="right">
            <table border="1" width="200" align="right" cellspacing="0" cellpadding="0" bgcolor="#FF00FF" height="100%">
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                </tr>
            </table>
        </div>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</td>
    </tr>
</table>

</body>

</html>

The table has height="100%" ... so what's the problem?

You need to change

<div align="right">

to

<div align="right" style="height: 100%;">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM