Forum Moderators: open

Message Too Old, No Replies

IE7 XHTML 1.0 Transitional Table Height

IE7 row height issue

         

mitrin

11:39 pm on Feb 22, 2008 (gmt 0)

10+ Year Member



I have an issue with the code below. If you view this code on IE6 / FF it will perform like it should - the top row has the desired height of 18px and the bottom row is 33 px heigh. The center TR will take the rest of space. If you view this on IE7, the top and bottom rows will expand beyond their defined heights, while the height of the entire table is the proper height of 315.

Is there a way, without changing or removing the DOCTYPE, to have the same functionality with rowheights accross IE7, IE6, and Firefox?

Thank you for any assistance.

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<BODY>
<table border="1" height="315">
<tr><td height="18" style="background-color: red;">1</td></tr>
<tr><td>IE7 table height bug (XHTML)</td></tr>
<tr ><td height="33" style="background-color: red;">bottom</td></tr>
</table>
</BODY>
</HTML>

tedster

1:33 am on Feb 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello mitrin, and welcome to the forums.

The height attribute in a td element is now deprecated, and it was always just a "recommendation" for the browser's rendering engine, as it cannot be an ironclad restriction. There's a lot of wiggle room for browser coders in the W3C recommendations so they can avoid issuing contradictory instruction to their rendering engine - and IE seems to take the most liberties of the major browsers.

See this thread about a similar issue for more discussion:
[webmasterworld.com...]

You may need to rethink the layout. As mcvos posted in the above thread "I'm getting the impression that sometimes starting over completely can actually save time."

SuzyUK

10:25 am on Feb 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ditto the above

however as this is a fixed height table you could just give the middle row the missing height - 264px? - or maybe this is just a sample

mitrin

4:30 pm on Feb 25, 2008 (gmt 0)

10+ Year Member



Thanks for replay tedster, SuzyUK. After i read all issues with Hight problem in this mode i decide to change layout.