JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<table>
<tr>
<th><input type="checkbox" name="key" class="key"></th>
<th><input type="checkbox" name="key" class="key"></th>
<th><input type="checkbox" name="key" class="key"></th>
<th><input type="checkbox" name="key" class="key" checked></th>
</tr>
<tr>
<th><input type="checkbox" name="key" class="key"></th>
<th><input type="checkbox" name="key" class="key"></th>
<th><input type="checkbox" name="key" class="key"></th>
<th><input type="checkbox" name="key" class="key"></th>
</tr>
<tr>
<th><input type="checkbox" name="key" class="key"></th>
<th><input type="checkbox" name="key" class="key"></th>
<th><input type="checkbox" name="key" class="key"></th>
<th><input type="checkbox" name="key" class="key"></th>
</tr>
<tr>
<th><input type="checkbox" name="key" class="key" checked></th>
<th><input type="checkbox" name="key" class="key"></th>
<th><input type="checkbox" name="key" class="key"></th>
<th><input type="checkbox" name="key" class="key"></th>
</tr>
</table>
JavaScript
$('.key').change(function(e){
e.preventDefault();//Отключаю смену состояния чекбокса, сделаю это сам
var $this=$(this),
$table=$this.parents('table'),
index=$this.parents('th').index(),//Номер столбца
change_property=function(){
var $t=$(this);
$t.prop('checked',!$t.prop('checked'));
};
$this.parents('tr').find('[type="checkbox"]').each(change_property);
$table.find('tr').each(function(){
$(this).find('th').eq(index).find('[type="checkbox"]').each(change_property);
});
});