Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with table heights 1

Status
Not open for further replies.

LaneyVC50

Technical User
Mar 1, 2002
17
GB
I have a single table, width is 100%, height 100%

There are 3 rows - the top one is 60px high and contains the client's logo. The bottom one is 80px high and contains the name, contact details etc.

For the middle row, the <tr> height is set to 100% so that it stretches to fill the screen.

My problem is that in IE5.5 it works, but when using IE6 it doesn't.

Any ideas?
TIA
 
In IE 6 what does it do? Not all browsers support the height attribute, btw.

Try putting this at the top of the html page (replacing any other you may have):

Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;>

Note: don't include a link to the DTD in the <doctype> - this will prevent IE going into &quot;strict&quot; mode.

I found this covered to some degree here:

All the best,
Jeff
 
Thanks, I'll try that when I get home and let you know how I get on

In IE5.5 the middle row stretches to fill the height of the screen (as expected), but in IE6 it doesn't, so the bottom row with the contact details in it appears mid-way down the page, if there's not a lot of content in it

I designed the page at work (IE5.5) and when I took the files home to upload them, I had a final check through and noticed the error.

Maybe I should just stick with absolute values....or change my design!! ;-)
 
Laney,

That's weird... Check out the following code:

Code:
<HTML>
<HEAD>
</HEAD>
<BODY>

<TABLE WIDTH=&quot;100%&quot; HEIGHT=&quot;100%&quot; CELLPADDING=&quot;0&quot; CELLSPACING=&quot;0&quot; BORDER=&quot;1&quot;>
<TR HEIGHT=&quot;60&quot;><TD>Top row</TD></TR>
<TR HEIGHT=&quot;100%&quot;><TD>Middle row</TD></TR>
<TR HEIGHT=&quot;80&quot;><TD>Bottom row</TD></TR>
</TABLE>

</BODY>
</HTML>

In IE 6 (with SP1), this produces the results you desire - a 60-pixel high top row, an 80-pixel high bottom row, and a middle row that scales to fit.

Does running the above code not do the same for you?

Dan
 
I assign my table heights in my <td> tags (instead of <tr>). I haven't seen any problems between IE versions.


Hope This Helps!

Ecobb

&quot;Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer.&quot; - Homer Simpson
 
Height is not a supported standard, and really should not be used. Allow your tables to automatically adjust to height. All cells in a row will adjust to the highest element. If you need a certain, consistent height, create an image that is one pixel wide and the set amount of pixels high and include that in the table.

Another way would be to use CSS to set all areas, and not use tables at all.

When in doubt, deny all terms and defnitions.
 
Cheers for the help guys

The client wants their contact details on every page and across the bottom seemed like a good place to put it. It's a fluid design so I wanted it to appear at the bottom of the screen and not vary in position if the contents of a particular page were particularly sparse. In retrospect I think I'll just change the design!!! :)

BillyRayPreachersSon - that's basically what I did - I even tried it on a completely new page - works fine in IE5.5 but not in IE6....until I tried BabyJeffy's idea of removing the url from the <doctype>

Mick
 
Why not use a server side include (makes updating the info easy in the future), and use absolute positioning with CSS to position the contact info.

When in doubt, deny all terms and defnitions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top