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

 
Updated October 22, 2001

HTML Tip:
Cross-Browser Table Formatting

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

  
June 1999
Vol. 2, No. 6
 • Server Tip
 • HTML Tip
 • Business Tip
  

Be careful about ending a table cell with text formatting elements such as   (no-break space), P, and BR. These elements can cause your table to be rendered incorrectly under older versions of Microsoft Internet Explorer.

If you use a table to control the layout of your Web page, then at some point you've probably used a text formatting element as the last thing in a table cell. This lets you add extra white space at the end of the cell.

For example, suppose you want to use a table to create an inset box to emphasize a point. You might use the code shown below:

1:  <table width=100 cellspacing=0 
       cellpadding=0 border=0>
2:  <tr>
3:     <td bgcolor="black">
4:        &nbsp;
5:     </td>
6:  </tr>
7:  <tr>
8:     <td>
9:        <br>
10:       <font size=5 face="arial">
11:       This is an important point
12:       </font>
13:       <br><br>
14:    </td>
15: </tr>
16: <tr>
17:    <td bgcolor="black">
18:       &nbsp;
19:    </td>
20: </tr>
21: </table>
Sample inset box

This code creates the inset box shown at right.

The key here is the use of the BR tag on lines 9 and 13. These tags force white space between the text and the black cells. If you didn't do this, your text will butt up against the black cells.

Unfortunately, this technique isn't 100% reliable because older browsers handle trailing format elements differently. If a BR tag is the last thing in a table cell, Netscape Navigator will always insert the break; many older versions of Internet Explorer ignore the break.

Sample inset box

The picture to the left shows our table as rendered by MSIE Version 3.0. Notice that browser ignores the tags on line 13 of our code, so the black cell at the table bottom runs into our text.

This problem occurs in MSIE Version 3.0 and earlier, as well as some versions of MSIE 4.0. More recent versions of Internet Explorer changed the rendering engine to correct the problem.

How significant is this problem? Keep in mind that MSIE 3.0 currently makes up about 4% of the browser market. Even including the few versions of MSIE 4.0 that have this problem, the total number of browsers affected is probably less than 10% of the market.

So one approach is simply to ignore the problem. However, if you want your page to be fully compatible with older browsers, you might consider using a different approach. You could achieve the same formatting effect by using a transparent GIF or by setting the HEIGHT attribute for the TD element. Both of these approaches are compatible with the Version 3.0 browsers. Try these approaches and see how they work in your page.

Read our browser compatabilty tutorial to learn how to make your site compatible with all 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.