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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Empty table cell taking up space

Status
Not open for further replies.

LuckyKoen

Programmer
Feb 14, 2005
57
BE
I have a table that looks like this :

Code:
<table cellspacing="0" cellpadding="0" border="0">
   <tr>
      <td bgcolor="#9999FF">
         One
      </td>
   </tr>
   <tr>
      <td></td>
   </tr>
   <tr>
      <td bgcolor="#9999FF">
         Two
      </td>
   </tr>
</table>

In my browser the 2nd table cell is still about 1 pixel high even when there is nothing in it, this gives a thin white line between the 1st and the 3rd table cell. How can I completely hide this 2nd table cell ?

Thanks in advance,
Koen


 
I have to suggest this dumb solution:
Code:
<table cellspacing="0" cellpadding="0" border="0">
   <tr>
      <td bgcolor="#9999FF">
         One
      </td>
   </tr>
   <tr>
      <td bgcolor="#9999FF">
         Two
      </td>
   </tr>
</table>
Could you explain why you need that cell?
 
Use this to completely hide it (and the row):
CODE
<tr style="display:none;">
<td></td>
</tr>
Cheers,
Jeff

Jeff's Page @ Code Couch

Doh.. I tried display:none in the td but not the table row. This works fine, thanks.

Could you explain why you need that cell?

I have a list of users and I want to use a table to display each of them. I also have a searchbox where you can start typing the name of the user. Javascript will hide all the users that don't match the value of the searchbox so this will leave me with alot of hidden tablecells.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top