Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jlogin

macrumors newbie
Original poster
Nov 23, 2004
4
0
I'm trying to figuire out a problem in safari:
The code below contains a table that has three rows. The cell in the second row has a height of 100%, and a green background. How do I get the middle row to actually expand so that the green background fills in the whole area between the top row and the bottom... am I missing something?

<table cellpadding=0 cellspacing=0 height=500 border=1>
<tr>
<td>
asdfsad
</td>
</tr>
<tr>
<td bgcolor=green height="100%">
sd
</td>
</tr>
<tr>
<td>
asdfsd
</td>
</tr>
</table>
 
Safari, and most browsers do not like height=100%. I hear it is fixed in the next release. I have the same problem on my web portfolio site.
 
ChicoWeb said:
Safari, and most browsers do not like height=100%. I hear it is fixed in the next release. I have the same problem on my web portfolio site.

By most browsers you mean most Mac browsers... right. This has always worked on IE and Mozilla on a pc... Seems like such a basic thing.
 
jlogin said:
By most browsers you mean most Mac browsers... right. This has always worked on IE and Mozilla on a pc... Seems like such a basic thing.

Well, IE "gives" a lot on standards compliancy. I do not believe Height="100%" is valid actually. But like I said, it will be fixed in the next version.
 
kingjr3 said:
Since your table is of fixed height, just define fixed heights on ALL of your rows, not just the middle one.

The actual table I am working with has a height of 100%. I just set a static height on the example for testing purposes. The table is part of a template, with the top row being a header, the middle being for content, and the bottom being a footer. In the content row is another table with two columns. The left column is for Nav/Callout, and the right is main content. The left column of the nested table has a background color and a colored border. Because of this issue, when there is not enough content on the page, the nested table does not reach the bottom of the page... because the cell it is in does not meet the top of the footer. I guess people on Macs will have to deal with it looking odd... not much I can do about it.

So when does this new version come out?
 
jlogin said:
The actual table I am working with has a height of 100%. I just set a static height on the example for testing purposes. The table is part of a template, with the top row being a header, the middle being for content, and the bottom being a footer. In the content row is another table with two columns. The left column is for Nav/Callout, and the right is main content. The left column of the nested table has a background color and a colored border. Because of this issue, when there is not enough content on the page, the nested table does not reach the bottom of the page... because the cell it is in does not meet the top of the footer. I guess people on Macs will have to deal with it looking odd... not much I can do about it.

So when does this new version come out?

With the new OS
 
Height is not a true attribute. Safari and other browsers that are ignoring it are doing correctly. Newer browsers have started to stop supporting height because it was never intended to be an attribute, I believe Netscape was at fault here. CSS will replace this method (currently the height css value, when set to 100%, tends to fail in some browsers as well).

All table attributes are listed here on this page:
http://www.w3schools.com/tags/tag_table.asp

You can also search this topic on the w3c page.
 
zim said:
Height is not a true attribute. Safari and other browsers that are ignoring it are doing correctly. Newer browsers have started to stop supporting height because it was never intended to be an attribute, I believe Netscape was at fault here. CSS will replace this method (currently the height css value, when set to 100%, tends to fail in some browsers as well).

All table attributes are listed here on this page:
http://www.w3schools.com/tags/tag_table.asp

You can also search this topic on the w3c page.

Zim,
I'm talking about the the height on the TD tag, not the Table Tag.
http://www.w3schools.com/tags/tag_td.asp. The root of my problem is the TD not expanding correctly. If you need further clarification, then take the code snippit I provided and view it with safari.
 
jlogin said:
Zim,
I'm talking about the the height on the TD tag, not the Table Tag.
http://www.w3schools.com/tags/tag_td.asp. The root of my problem is the TD not expanding correctly. If you need further clarification, then take the code snippit I provided and view it with safari.

Yes the td tag does have a height attribute However, the td attribute is depreciated in html 4.01 and should be avoided. At some point the height tag will be obsolete and css will be the only solution.

See the comment on the top of the w3schools page regarding the td tag ;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.