Forum Moderators: not2easy

Message Too Old, No Replies

Table Cell height in "Compliant" IE

         

Lance

2:45 pm on Jul 29, 2004 (gmt 0)

10+ Year Member



I've searched for an answer to this for a couple of days now and haven't found anything. Of all the forums I've come across, it looks like you guys are the place ask. Please be kind to the noob.

This is a greatly simplified example of the problem I am having:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test</title>

<style type="text/css">
HTML, BODY
{
MARGIN: 0px;
HEIGHT: 100%;
}
TABLE
{
HEIGHT: 100%;
WIDTH: 50%;
BORDER: #000080 3px solid;
MARGIN: 0px auto;
}
TD
{
BORDER: navy 1px solid;
TEXT-ALIGN: center;
}
.Cell1, .Cell3
{
HEIGHT: 20%;
}
.Cell2
{
HEIGHT: auto;
}
</style>
</head>

<body>
<table>
<tr>
<td class="Cell1">Top Row - Set to: 20%</td>
</tr>
<tr>
<td class="Cell2">Center Row<br>Should expand vertically to fill remainder of table</td>
</tr>
<tr>
<td class="Cell3">Bottom Row - Set to: 20%</td>
</tr>
</table>
</body>
</html>

I would expect this to render the top and bottom cells at a height of 20% of the viewport, with the center cell expanding to fill the remaining vertical space. In Netscape, or IE in "quirks" mode, this is if fact how it renders. In IE in "compliant" mode however, the center cell is reduced to slightly more height than required by the contents, and the top and bottom cells expand equally to fill the remainder of the viewport.

Am I just missing something stupid here, or is this a bug in IE in "compliant" mode?

Thank you in advance for your assistance.

-Lance

Lance

11:56 pm on Jul 30, 2004 (gmt 0)

10+ Year Member



Anyone?

Lance

5:57 pm on Aug 4, 2004 (gmt 0)

10+ Year Member



Did I ask the question incorrectly or something?

Not even a "Welcome to the forums" reply?

What am I doing wrong?

Thank you.

SuzyUK

6:14 pm on Aug 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld - Lance!

and please accept apologies.. can't believe we all missed this so long - sorry!

there's nothing wrong with the question at all, but as far as I know you've answered it yourself. It will only work in IE quirks, I'm not sure that's it an IE bug though I think it more that "height" is not actually a supported attribute of tables, but I will need to check for actual confirmation of that.. bit rusty with the ol' tables and I seem to remember this may have been asked over on the HTML forum quite recently too

Anyone have the link or can add more facts?

Suzy

Noisehag

6:48 pm on Aug 4, 2004 (gmt 0)

10+ Year Member



Once again, another problem that goes away when the doctype is removed. There must be a compliant way of achieving this. I'll be watching these threads very closely for any work arounds.