Need some HTML table help - please

jordank32

Member
Jul 12, 2004
137
0
0
I am working on a website for a class and I am having a difficult having tables expand properly. I am going to simplify the code so you can get the general idea. I want a table to take the entire height of the page and have 1 row and 3 columns. I want the top row to be 20 pixels, the bottom row to be 20 pixels, and the center row to fill the rest. The code I have works fine in Firefox but not in IE. IE redistributes all of the row heights evenly. I really need this to work. Please help, here is the code:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<link href="main.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="fullheight">
<tr>
<td height="20" bgcolor="#FFFF00"></td>
</tr>
<tr>
<td bgcolor="#990000"></td>
</tr>
<tr>
<td height="20" bgcolor="#FFFF00"></td>
</tr>
</table>
</body>
</html>

And the .css

html, body{
height:100%;
margin: 0;
padding: 0;
border: none;
}
.fullheight{
background-color: #FFFFFF;
height:100%;
margin: 0 auto;
}
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
hmmmm....
i tried viewing your page in MSIE 6.0 (win2k), and it takes up the full height of the browser window.
what version of MSIE did you try the code on?

works fine on mozilla 1.7.5 as well
 

AFB

Lifer
Jan 10, 2004
10,718
3
0
Originally posted by: jordank32
I want a table to take the entire height of the page and have 1 row and 3 columns. I want the top row to be 20 pixels, the bottom row to be 20 pixels, and the center row to fill the rest.

:confused:
 

Zugzwang152

Lifer
Oct 30, 2001
12,134
1
0
Originally posted by: AFB
Originally posted by: jordank32
I want a table to take the entire height of the page and have 1 row and 3 columns. I want the top row to be 20 pixels, the bottom row to be 20 pixels, and the center row to fill the rest.

:confused:

sounds like someone hasn't heard of <div> and <span> eh? ;)
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
Lol....
i just noticed the small but fatal typo....

i think he meants 3 rows and 1 column? ,p
 

royaldank

Diamond Member
Apr 19, 2001
5,440
0
0
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="fullheight">
<tr height="20">
<td bgcolor="#FFFF00"> test </td>
</tr>
<tr height=*>
<td bgcolor="#990000"> </td>
</tr>
<tr height="20">
<td bgcolor="#FFFF00"> test </td>
</tr>
</table>


I usually set table height in opening table tag, and row heights in the <tr> tags. I believe the above works in IE for what you described.