Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Void cells in tables

Status
Not open for further replies.

MiBJ

Programmer
Oct 22, 2000
7
0
0
RU
I have a problem.

I wanted to make a table where some cells should be empty. When I entered the following code the first and the third cells didn't change the color in Netscape. It works well in IE. What must I do to make it work in Netscape?

I tried to insert <br> and š inside the empty cells and it worked well but it is a bad way to solve the problem, isn't it?

Code:
 <table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;2&quot; width=&quot;95%&quot;>
  <tr>
   <td height=&quot;14&quot; width=&quot;14&quot; bgcolor = #0000ff></td>
   <td bgcolor = #0000ff>
    <center><font color=#ffffff><b>Title of table</b></font></center>
   </td>
   <td height=&quot;14&quot; width=&quot;14&quot; bgcolor = #00ff00></td>
  </tr>
 </table>
 
put &nbsp; inside the cell coz if u dont put any text or images inside cells in Netscape i think it just ignores them.

:D
 
What the above post that has suffered from the problem that html forums are bound is trying to say is that you need something in the table for it to display the coloured background in Netscape. A non-breaking space is enough, just enter &nbsp; into blank table cells.
 
What is coz? ;-)

The reason why I don't want to insert [ignore]&nbsp;[/ignore] is that it makes the cell to have the height of a character. Are any other ways? MiBJ,
mighty_bombjack@mail.ru
 
Create a transparent 1x1 pixel image and use it instead of & nbsp;. That way you can give the img tag a height a width to make the cell work the way you want it to.

Mitch
 
sorry, it was meant 2 b &quot;& nbsp;&quot; or just insert transparent gifs like compweb said

:D
 
Can anybody explain the reasons of such behaviour of NN? Do they think that void cells should be really void? Or it is a bug? MiBJ,
mighty_bombjack@mail.ru
 
You can also modify the size of the space by modifying the font of the space, of course if you dont want to use the shim.gif

<small>&nbsp</small>
-or-
<font size=1>&nbsp</font>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top