homepage Welcome to WebmasterWorld Guest from 54.167.244.71
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Classic problem.
Table Height Management.
Willis




msg:3263087
 4:23 am on Feb 25, 2007 (gmt 0)

No, this isn't the classic "how do I do 100%" problem..

I'm trying to build up a table that has both fixed structure and adjustable. The problem is the weight isn't being shuffled where it's supposed to be.

Here let me give an example:

<html>
<head>
<title></title>
</head>
<body>
<table cellpadding="0" cellspacing="0" border="1">
<tr bgcolor="0000AA">
<td width="20" height="20"></td>
<td width="900" height="20"></td>
<td width="20" height="20"></td>
</tr>
<tr bgcolor="0000AA">
<td width="20" height="50">50</td>
<td width="900" rowspan="3"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></td>
<td width="20" height="50">50</td>
</tr>
<tr bgcolor="005500">
<td width="20"></td>
<td width="20"></td>
</tr>
<tr bgcolor="0000AA">
<td width="20" height="100">100</td>
<td width="20" height="100">100</td>
</tr>
<tr bgcolor="0000AA">
<td width="20" height="20"></td>
<td width="900" height="20"></td>
<td width="20" height="20"></td>
</tr>
</table>
</body>
</html>

50 and 100 are the heights I want it to stay, no variation no exceptions. The main body is fine and expected to adjust, but to compensate for those adjustments I want two cells on either side to adjust also.

Instead those cells stay in it's smallest state and the changing height occurs on the 50 and 100 value cells.

How should I go about fixing this? (and if someone is good with DIV's and CSS instead of tables, I'll take that advice too).

 

tedster




msg:3265664
 5:59 pm on Feb 27, 2007 (gmt 0)

You're right - it's a classic and it's probably going to take a different design approach. The issue is that the W3C calls height attributes for table cells "recommendations". So visual browsers are not asked to treat height attributes as constraints or rules, and they don't. In fact, each browser follows a different pattern of decision making.

There is solid reasoning here - even though it can be frustrating. If height attributes were taken literally, then web authors could create valid but contradictory height instructuctions that would crash or freeze the browser.

I played with your mark-up for a bit, but no joy I'm sorry to report. Note as well that height and width attributes for <td> elements are deprecated in HTML4. See [webmasterworld.com...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved