Bob Bob - 8 months ago 20
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.



You need to add this to your CSS:

table { border-collapse:collapse }