tags:

views:

6049

answers:

3

Kindly look at the following code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;

<head>
</head>
<body>
<table id="content" height="525" border="0" cellspacing="0" cellpadding="0">
<tr style="height:9px"><td height="9" bgcolor="#990000">Upper</td></tr>
<tr><td  bgcolor="#990099">Lower</td></tr>
</table>
</body>
</html>

IE ignores the "height:9px" and I can't get what I want. Also, without the DOCTYPE, it works. But I have to follow the standard so that DOCTYPE cannot be removed. Does anyone how to fix the height of the upper row?

Some clarifications: 1. The height of second row may vary according to users' action and cannot be fixed. 2. The height of the table is set to 525px so the table has a minimum height of 525px

+1  A: 

the bottom cell will grow as you enter more text ... setting the table width will help too

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;

<head>
</head>
<body>
<table id="content" style="min-height:525px; height:525px; width:100%; border:0px; margin:0; padding:0; border-collapse:collapse;">
<tr><td style="height:10px; background-color:#900;">Upper</td></tr>
<tr><td style="min-height:515px; height:515px; background-color:#909;">lower<br/>
</td></tr>
</table>
</body>
</html>
roman m
It does not work.
Billy
try again ... copy/paste
roman m
and stick all the other "view" properties into your style attribute, better yet - external css file :)
roman m
Some clarifications:1. The height of second row may vary according to users' action and cannot be fixed.2. The height of the table is set to 525px so the table has a minimum height of 525px
Billy
try it, bottom cell will grow with the content ... set width:50px; to see results quick
roman m
It really works. Thanks a lot.
Billy
if it really worked, you'd up-vote that :)
roman m
A: 

This works as long as you remove the height attribute from the table

<table id="content" border="0" cellspacing="0" cellpadding="0">
<tr><td height='9' bgcolor="#990000">Upper</td></tr>
<tr><td height='100' bgcolor="#990099">Lower</td></tr>
</table>
A: 

No, it doesn't work! I have the same problem. Here is example, whisch works ok with Opera and Mozilla, but FAIL whith IE.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;

<head>
</head>
<body>
<table id="content" border="0" cellspacing="0" cellpadding="0">
<tr><td height='9' bgcolor="#990000">Upper</td> <td rowspan=2>     a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br></td>
</tr>
<tr><td height='100' bgcolor="#990099">Lower</td></tr>
</table>
</body>
</html>
Stream