Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 7th, 2005, 12:34 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default Cell Height not behaving nicely

Hi All.
Im trying to get my table to strech the full height of the page, which I have done successfully.
BUT... I can not seem to get the cells within the table to conform to their height attributes.
It appears that the middle cell which I hope to be the body of the page will not accept the height="*" attribute.
Is this not accepted?
If I use 100%, It pushes the tables height beyond the page as the other cells have fixed height values.
What is the correct way to do this?
What I want is a table spanning the whole page width and height with three rows, the first is to be say 100px high, the footer is to be say 50px high and the middle cell it to take up the rest.

Any help would be greatly appreciated.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ASW Home</title>

    <style type="text/css">
    body{color:#000; background-color: #fff;}
    table{
        border-width: 0;
    }
    html, body{
        height:100%;
        margin: 0;
        padding: 0;
    }
    .FullHeight{
        height:100%;
        margin: 0;
    }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <table class="FullHeight" width="100%" border="1">
            <tr valign="top">
                <td height="100px">
                    Header
                </td>
            </tr>
            <tr valign="top">
                <td height="*">
                    Body
                </td>
            </tr>
            <tr valign="top">
                <td height="50px">
                    Footer
                </td>
            </tr>
        </table>
    </form>
</body>
</html>



======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
__________________
======================================
"They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad."
--Shakespeare
======================================
 
Old March 9th, 2005, 03:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

The reason for the issue seems to be a difference in ASP.NET 2 to ASP.NET 1.1.
I get the correct result using Visual Studio 2003.
But it does not work in VS 2005 Beta.
It is all html though



======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old February 24th, 2006, 10:43 AM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's a problem with DOCTYPE. Delete it and everything will work fine.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed table height and row height rajanikrishna HTML Code Clinic 3 January 18th, 2007 12:42 AM
Table Cell Auto Stretching When Height Is Defined rsearing CSS Cascading Style Sheets 5 November 26th, 2006 10:26 AM
Database Connection not Behaving rit01 ASP.NET 2.0 Basics 1 July 7th, 2006 10:55 PM
Access behaving badly mega Classic ASP Databases 6 November 17th, 2003 02:27 PM
Change height of div element if < window height JoelJunstrom Javascript How-To 1 October 10th, 2003 09:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.