Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
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:
 
<HTML>
<HEAD>
<TITLE>Empty cells</TITLE>
</HEAD>
<BODY>

<P>
<TABLE bgColor=#99cccc 
border=1 borderColor=#669999 
borderColorDark=#ffffff borderColorLight=#000000 
cellPadding=4 cellSpacing=1>
    
    <TR>
        <TD>A</TD>
        <TD> </TD>
        <TD>2</TD></TR>
    <TR>
        <TD>B</TD>
        <TD>2</TD>
        <TD>5</TD></TR>
    <TR>
        <TD>C</TD>
        <TD>6</TD>
        <TD>&nbsp;</TD></TR>
        
</TABLE></P>

</BODY>
</HTML>
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.

 

 

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