Forum Moderators: open

Message Too Old, No Replies

Table height="100%" gives different results on different browsers

         

john_m

11:55 pm on Apr 4, 2005 (gmt 0)

10+ Year Member



Hi there,

I've just started work on the site,

<Sorry, no personal URLs.
See Terms of Service [webmasterworld.com]>

and have set the main table's height to be 100%. It displays fine in IE but in Firefox it doesn't fill up the whole page.

The HTML code is:
<table class="main" border="0" cellspacing="0" cellpadding="0"> and the CSS value for main is:
table.main {HEIGHT: 100%;}

Please help me because this is giving me a headache. I've tried many different combinations of CSS and HTML and have got the same result. Thanks in advance.

[edited by: tedster at 12:15 am (utc) on April 5, 2005]

MWpro

1:57 am on Apr 5, 2005 (gmt 0)

10+ Year Member



Try setting the height of the body to 100% as well.

john_m

7:23 am on Apr 5, 2005 (gmt 0)

10+ Year Member



I've set the height of both the body and the HTML to 100% to no avail :(

tedster

7:31 am on Apr 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is your purpose to have the layout perfectly fill the WINDOW? Or is it to fill the entire height of the PAGE - which also gets filled with other content in some other part of the layout?

john_m

10:12 am on Apr 5, 2005 (gmt 0)

10+ Year Member



the purpose is to fill up the whole screen so that at various resolutions, the table fills up the whole screen vertically.

------------------------
¦ ¦ TABLE ¦ ¦
¦ ¦ ¦ ¦
¦ ¦ ¦ ¦
¦ ¦ ¦ ¦
------------------------

The table is in the center of the page and has a different color that the background.

john_m

10:14 am on Apr 5, 2005 (gmt 0)

10+ Year Member



ignore my cheap ascii art- it didn't turn out right :(

tedster

10:58 am on Apr 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, that's just weird. You said you have html and body rules for height:100% correct? And then the table has a class that also has a height:100% rule. And it's also the main "container" table for the page, not inside any other parent element except for body and html.

That really should do it as far as I know, unless there are errors in one or both documents. Have you validated the HTML and the CSS? I just solved a rendering problem for a friend and it boiled down to a missing } in his CSS file. You could stare for a long time and not see some typos, so it's good to check.

W3C Validator - HTML [validator.w3.org]
W3C Validator - CSS [jigsaw.w3.org]

john_m

7:17 am on Apr 7, 2005 (gmt 0)

10+ Year Member



It's the doctype (XHTML Transitional)! Once I remove it, it looks fine in Firefox- 100% height like I wanted. :( Aaargh!

tedster

9:13 am on Apr 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Removing the doctype puts the browser into quirks mode - so that makes some sense. Firefox acts a lot more like IE in quirks mode. However, there still should be a way to do this in standards mode.

I've got my thinking cap on - you should not need to remove a DTD to get a page to render.

bigtoga

2:59 pm on Apr 27, 2005 (gmt 0)

10+ Year Member



I found this whilst googling for the same issue myself: [apptools.com...]

You might dig the explanations

bigtoga

3:03 pm on Apr 27, 2005 (gmt 0)

10+ Year Member



Also, this thread has a workable solution to using standards mode at the bottom:

[webmasterworld.com...]