Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Web
Expertise: All
Feb 22, 1999

Put Non-Breaking Spaces in Empty HTML Table Cells

The tables that you design so carefully could end up looking odd in Internet Explorer or Netscape Navigator. The trouble is that browsers treat empty table cells differently. For instance, an empty cell may be rendered without borders, which can be visually distracting. To give an even appearance to all cells, including empty cells, insert the HTML code for a non-breaking space ( ). A regular blank space doesn't work. You can see the effect of using   by viewing this code in your browser:
<TITLE>Empty cells</TITLE>

<TABLE bgColor=#99cccc 
border=1 borderColor=#669999 
borderColorDark=#ffffff borderColorLight=#000000 
cellPadding=4 cellSpacing=1>
        <TD> </TD>

Browsing this code looks like:

A 2
B 2 5
C 6  

Ken Cox
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date