Forum Moderators: open

Message Too Old, No Replies

NN4 Table bgcolor Fun

         

visualguy

2:46 am on Jun 9, 2002 (gmt 0)



Is there any reason Netscape 4 would suddenly ignore table background colors? Seems to work fine until I nest a couple of tables, then just it defaults to the body bg color. And while I'm at it, Netscape also ignores certain parts of my CSS stylesheet, like everything under 12 pts. This is quite frustrating. Of course, everything looks great in Explorer and Opera. Any advice?

papabaer

3:12 am on Jun 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Netscpae 4 is a hard-case when it comes to nested tables and even moderately advanced CSS. You can eliminate the nested table design and keep your CSS simple or consider dropping table layouts altogther and opting for a CSS layout.

The W3C discourages using tables for layout implementaion, instead they recommend designers utilize CSS positioning as the means for page design. Many of Webmaster World's members have already migrated to "tableless" designs. The advantages are a reduction in page code and an increase in "searchability," not to mention page code that is infinately easier to manage.

Here is a good place to review some options:
[w3.org...]
[nypl.org...]

Give 'em a good read! ;)

Reno

3:40 am on Jun 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here is a tip I got a month or so ago at a forum posting somewhere, and found it so helpful I saved it to a notepad document. I tried this suggestion, and to my surprise, it fixed my NS table nesting problem. I am quoting from that post exactly:

==========================

The scenario - In Netscape 4.x, if you use a background image on a table, any nested tables will inherit the same background image and not be transparent the way they should be. In other words, the background image is re-started (overlaid) in the nested table.

The author who pointed this bug out also mentioned a useful fix which does not appear to be at all harmful: specify an empty BACKGROUND attribute (BACKGROUND="") in nested TABLE elements in this scenario.

==========================

Hope this helps solve your own NS problem.....

visualguy

6:17 am on Jun 9, 2002 (gmt 0)



Thanks for the help, guys. I seem to have found the problem with the table bgcolor in NN4. I'm using Dreamweaver, which puts &nbsp after each table </td> that does not contain text. I got into the habit of removing these on tables with text, because I didn't want the extra space. When I put them back, NN4 renders the color again and all is well.

Thanks for the links, papabear. I'm still actually trying to learn the old standard before I learn the new one, just for versatility.

Cheers

rewboss

11:34 am on Jun 10, 2002 (gmt 0)

10+ Year Member



Netscape will not draw a table cell if it has no content, so the background colour will only show up if the <td> contains at least (as you have discovered) a non-breaking space.

Sometimes you may need a cell that's much smaller than can be achieved with a non-breaking space; in which case you can create a GIF consisting of one pixel, which you make transparent. Use width and height attributes to force graphic to a particular size. This is the famous "single-pixel transparent GIF trick" which you can use in many other different ways.