In the CSS code below, I currently alternate background colors for table lines by default and can specify individual rows to not alternate.
Is there a way to implement this at the table level instead of per row? Essentially, I want to define something at the table level rather than for each row.
In simpler terms: the idea of "this table's rows do not alternate" logically belongs to the table itself, not its rows. Therefore, if feasible, I would prefer to assign that attribute to the table instead of every row.
Is this achievable?
table tr:nth-child(odd) {
background-color: #f1f1f1;
}
table tr:nth-child(even) {
background-color: #ffffff;
}
table tr.noLine {
background-color: #f1f1f1;
}
Many thanks,