-1

I have alternating background colors however they have breaks in-between them due to the large spacing. I want the color to run through as though there was no spacing, so a solid bar all the way through.

tr:nth-child(even) {
    background-color: #FFFFFF;
}
tr:nth-child(odd) {
    background-color: #000000;
}
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
SolidCloudinc
  • 329
  • 10
  • 27

2 Answers2

0
table{
    border-collapse: collapse; /* add this one */
}

Demo with issue
Demo without issue

Roko C. Buljan
  • 196,159
  • 39
  • 305
  • 313
0

In the table tag itself, use cellspacing="0" and cellpadding="0" to achieve the same effect but for browsers that don't (or poorly) support the border-collapse attribute.

You may also want to restore the lost space without creating gaps:

td{padding:2px 4px}
Schien
  • 3,855
  • 1
  • 16
  • 29