When it comes to CSS, specifying a style for the immediate child rows of a table can be done like this:
table > tr {
background: blue;
}
The challenge arises when we have a <tbody>
tag surrounding the <tr>
tags.
Is there a way to address both scenarios without resorting to this cumbersome code?
table > tr, table > tbody > tr {
background: blue;
}
Unfortunately, we can't simplify the code by using:
table tr {
background: blue;
}