Overcome Netscape problem of correctly displaying table cell background colors and images using this nice HTML tip.
background images and colors in tables under netscape, netscape table display problem, solution to netscape faulty table display
Background images and colors in tables under NetscapeGo to Background images and colors in tables under NetscapeHTML & JavaScriptGo to HTML and JavaScript tips and tricksTips and tricksGo to web development Tips and tricksHomepage

Background images and colors in tables under Netscape

Here is what you want to do... you make a table with a background image and put background color in some of the table cells. All this looks good in Internet Explorer, but the moment you check it in Netscape, you get a rude shock. Netscape blatantly ignores the BGCOLOR attribute of <TD>, overriding it with the BACKGROUND (image) of <TABLE>.

You check and recheck the HTML code but nothing seems to be wrong with it.

Here is how the table would look... (the table has a picture of Freddie Mercury as its background). Note: Internet Explorer users might not know the difference since the two tables below are rendered in the same manner. Hence, it is recommended that you view this page in Netscape.

CELL 1
CELL 2
CELL 3
CELL 4
CELL 5

Here is a simple solution to your problem.
Put a BACKGROUND attribute in each <TD> where a background color is desired and supply it with a URL of a 1X1 pixel transparent .gif image. The code for <TD> which works both in Netscape and I.E. is:

<TD BGCOLOR="#color_you_desire" BACKGROUND="blank.gif">
Cell Contents</TD>

The BGCOLOR attribute can take either hexadecimal color code or color name. Download the blank.gif from here.

Corrected table display in Netscape.

CELL 1
CELL 2
CELL 3
CELL 4
CELL 5

Further, to prevent tiling of the background image, place this table inside an outer 1 cell table. (Refer the previous tip for further details)

CELL 1
CELL 2
CELL 3
CELL 4
CELL 5


AddThis Social Bookmark Button


Page contents: HTML Tip: Getting Netscape to display correctly a table cell background or color on a web page.

Page URL: http://www.webdevelopersnotes.com/tips/html/ background_images_and_colors_in_tables_under_netscape.php3



Join Mailing List


Feedback/Questions




50+ web hosting FAQs

Search engine for your website

Free software from Google - The Google Pack Collection

Create your own search engine
Search WebDevelopersNotes.com