Bob Bob - 2 years ago 63
HTML Question

Removing unwanted table cell borders with CSS

I have a peculiar and frustrating problem. For the simple markup:

<tr class='odd'><td>x</td><td>y</td><td>z</td></tr>

I apply different background-color values to the thead, tr, and tr odd elements. The problem is that in most browsers, every cell has an unwanted border which is not the color of any of the table rows. Only in Firefox 3.5 does the table have no borders in any cell.

I'd just like to know how to remove these borders in the other major browsers so that the only thing you see in the table are the alternating row colors.


Answer Source

You need to add this to your CSS:

table { border-collapse:collapse }
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download