How to get css background color on <tr> tag to span entire row

H. Ferrence picture H. Ferrence · Apr 15, 2011 · Viewed 143.4k times · Source

I have tried everything I can think of in css in order to get a background color to span an entire table row (<tr> tag) But I keep getting a white border around each cell.

CSS (excerpt):

/*alternating row*/
table, tr, td, th {margin:0;border:0;padding:0;}
tr.rowhighlight {background-color:#f0f8ff;margin:0;border:0;padding:0;}

HTML (excerpt):

<tr class="rowhighlight"><td>A</td><td>B</td><td>C</td></tr>

It just does not want to cooperate. Thanks for helping...

Answer

Jaspero picture Jaspero · Apr 15, 2011
table{border-collapse:collapse;}