All tr
with ID 1 and all under them, before ID 2 should be the same color. Check the example. But it will not change after ID 2.
This is my code:
[id="1"], [id="1"] ~ tr {
background-color: blue;
}
[id="2"], [id="2"] ~ tr {
background-color: red;
}
<table>
<tbody>
<tr id="1"><td>foo</td></tr> <!-- Blue -->
<tr><td>foo</td></tr> <!-- Blue -->
<tr><td>foo</td></tr> <!-- Blue -->
<tr id="2"><td>foo</td></tr> <!-- Red -->
<tr><td>foo</td></tr> <!-- Red -->
<tr id="1"><td>foo</td></tr> <!-- Blue (But is Red) -->
<tr><td>foo</td></tr> <!-- Blue (But is Red) -->
<tr><td>foo</td></tr> <!-- Blue (But is Red) -->
<tr><td>foo</td></tr> <!-- Blue (But is Red) -->
</tbody>
</table>