JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tr>
<td><input type="checkbox" name="select[]" id="select[]"></td>
</tr>
</table>
CSS
td{width:100px;height:100px;text-align:center;}
.selectCheckbox{background:red}
JavaScript
$('input[type=checkbox]').on('click', function() {
var $this = $(this);
if ($this.is(':checked')) {
$this.closest('tr').addClass('selectCheckbox');
} else {
$this.closest('tr').removeClass('selectCheckbox');
}
});