Improve Site Performance Increase Site Traffic Monitor Site Uptime Webmaster Resources NetMechanic Home Looking For Help? Partner Programs Privacy Policy Contact Us Press Room
NetMechanic Home LOGIN | HELP | ABOUT US | PRODUCTS | SITE MAP
NetMechanic Menu
Over 52 Million Web Pages Tested!     
 

Search for:


Your Email:

I would like to receive my newsletter in:
HTML format
Text format



Volume 8 (2005)
   September
   June
   April
   March
   January

Volume 7 (2004)
   November
   September
   July
   June
   May
   April
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 6 (2003)
   December
   November (Part 2)
   November
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 5 (2002)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 4 (2001)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June (Part 2)
   June
   May (Part 2)
   May
   April (Part 2)
   April
   March (Part 2)
   March
   February (Part 2)
   February
   January (Part 2)
   January

Volume 3 (2000)
   December (Part 2)
   December
   November (Part 2)
   November
   October (Part 2)
   October
   September (Part 2)
   September
   August (Part 2)
   August
   July (Part 2)
   July
   June
   May
   April
   March
   February
   January

Volume 2 (1999)
   December
   November
   October
   September
   July
   June
   May
   April
   March
   February
   January

Volume 1 (1998)
   December
   November
   October
   September

 

HTML Tip:
Filling In Colored Table Cells

by Tom Dahm,
Chief Operations Officer,
NetMechanic, Inc.

  
November 1999
Vol. 2, No. 10
 • HTML Tip
 • Load Time Tip
 • Design Tip
  

If you use colored table cells on your page, be careful: your colors may not display under Netscape Navigator. But one simple step can ensure that your table colors display under all major browsers.

Both the TABLE and TD tags allow you to set a background color through the BGCOLOR attribute. If you want to set the color of a table cell, you can do it with a statement like this:

<TD BGCOLOR="black"> cell contents </TD>

You can use this to add a little extra color to your Web page. For example, you might use this code to create a logo for your page:

<TABLE BORDER="0" CELLPADDING="10">
  <TR>
    <TD BGCOLOR="black" WIDTH="50"> </TD>
    <TD WIDTH="100" ALIGN="center">
      <FONT SIZE="4">
      Welcome <BR> to My Page
      </FONT>
    </TD>
    <TD BGCOLOR="black" WIDTH="50"> </TD>
  </TR>
</TABLE>

Figure 1 shows this table as rendered by Microsoft Internet Explorer 5.0.

Colored Table Under IE
Figure 1 - Colored Table Viewed Under
Internet Explorer 5.0

This will work fine under all major browsers, so long as your table cell contains some sort of data. But if your table cell is empty, you may not get the results you expect. Netscape Navigator doesn't display empty table cells or their background color. Figure 2 shows how our sample table looks when viewed with Navigator 4.02. Notice that our black cells aren't rendered at all. This is true for all versions of Navigator.

Colored Table Under NN
Figure 2 - Colored Table Viewed
Under Navigator 4.02

Once you're aware of it, this problem is easy to solve. You need only put some HTML code or text inside the table cell. For example, you could change our table code to include a BR tag inside each of the colored cells. Even better, you could use the &nbsp; (no-break space) character to achieve the same effect, like this:

<TABLE BORDER="0" CELLPADDING="10">
  <TR>
   <TD BGCOLOR="black" WIDTH="50">&nbsp;</TD>
   <TD WIDTH="100" ALIGN="center">
     <FONT SIZE="4">
     Welcome <BR> to My Page
     </FONT>
   </TD>
   <TD BGCOLOR="black" WIDTH="50">&nbsp;</TD>
  </TR>
</TABLE>

Now our table will display the same under both major browsers.



Rate This Tip:
Not Useful Useful Very Useful   
 
NetMechanic Tools
HTML Toolbox
Browser Photo
Server Check
Search Engine Starter
Search Engine Tools
GIFBot
Newsletter
HTML Tutorial and Tips
Search Engine Tutorial
Accessibility Information
Browser Problem Tutorial

Company Info
Products
About Us
Contact
Advertise
Link To Us
Jobs
Privacy Policy
Partner Programs
Press Room
RSS Feed
Support
 



Powered by Overture!

 
     
 
   
 
     


Keynote Home
Copyright © 1996-2007,
Keynote NetMechanic
All rights reserved.