I use css to make my rows alternate like this: Fiddle
tr:nth-child(odd) td { background-color:red; }
tr:nth-child(even) td { background-color:blue; }
tr th { background-color: yellow}
table {
border: 1px solid black;
margin: 10px;
width: 100px;
}
Some tables have headers, and some tables do not. The data always needs start with red, but when a table has a header, its row is counted as first row and data starts with blue instead. Is there any way to make it always start with red?