JSFiddle - React, Tailwind, and code Playground
HTML
<!--
moved up
<input type="checkbox" id="generated-id"> <--------------+
| -->
<!-- | -->
<table> <!-- | -->
<thead> <!-- | -->
<th>columns</th> <!-- | -->
</thead> <!-- | -->
<!-- | -->
<tbody> <!-- | -->
<input type="checkbox" id="generated-id"> <!-- ---+ -->
<tr>
<td>
<label for="generated-id">
highlight this row
</label>
</td>
</tr>
</tbody>
</table>
CSS
input[type="checkbox"]:checked + tr {
background-color: #000;
}