Advertisement

07.08.2008 at 09:15AM PDT, ID: 23547214 | Points: 500
[x]
Attachment Details

Why is my 3 row table stretching 100% high, but the middle row stretches oddly in Internet Explorer?

Asked by Ultrus in Cascading Style Sheets (CSS), Internet Explorer Web Browser, Firefox Web Browser

Tags: , ,

Hello Gurus,
I'm troubleshooting a table that stretches 100% high,where the top and bottom row have pixel heights, and the middle row is supposed to stretch and fill the gap. This is working great everywhere but Internet Explorer, collapsing the middle row and making the top and bottom rows stretch.

In the example provided, the table fills the whole page. The actual template I'm working on mainly uses this type of table to fill different columns of the page layout to make variable height content in cell A line up with variable height content in cell B. The main template shell also follows this format, which could be changed, but that doesn't resolve what's going on with the content within the page.

I could "resolve" this issue by forcing IE into quirks mode like this:
<!--[if IE]>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<![endif]-->
<![if !IE]>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<![endif]>

However, that seems unprofessional and causes some other undesirable side effects. Any thoughts on how to make this work? If I have to, I'll rebuild every page but my boss wouldn't be too happy with that. :P I can also change the doctype if needed "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> " is not valid, so I guess I couldn't use that. I also want to leave the stone ages if I can with doctype.

I've seen some partial solutions in other areas, but have not hit the target yet.

Thanks for the assist! Let me know if I can provide further info.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>CSS height: 100%; Test</title>
<style type="text/css">
body, html {
	height: 100%;
	margin: 0px;
	background-color: #000000;
}
 
table {
	padding: 0px;
	border-spacing: 0px; 
	border-width: 0px;
	width: 100%;
	border-collapse: collapse;
	margin: 0px;
}
 
td {
	padding: 0px;
	border-spacing: 0px; 
	border-width: 0px;
	vertical-align: top;
	text-align: left;
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 10pt;
	margin: 0px;
}
</style>
</head>
<body>
    
      <table style="height: 100%; width: 100%;">
        <tr>
          <td style="height: 80px; background-color: #FF9900;">
    	      height: 80px;
          </td>
        </tr>
        <tr>
          <td style="background-color: #CC0000;">
          	height: (not specified - looks great in FireFox, causes odd stretching in IE, unless doctype is removed)
            
          </td>
        </tr>
        <tr>
          <td style="height: 30px; background-color: #FF9900;">
    	    height: 30px;
          </td>
        </tr>
      </table>
 
</body>
</html>
 
Loading Advertisement...
 
[+][-]07.08.2008 at 09:29AM PDT, ID: 21955457

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 09:39AM PDT, ID: 21955555

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 10:00AM PDT, ID: 21955820

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.09.2008 at 12:36AM PDT, ID: 21961297

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2008 at 08:40AM PDT, ID: 21964904

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2008 at 10:14AM PDT, ID: 21965978

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2008 at 10:43AM PDT, ID: 21966273

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628