JSFiddle - React, Tailwind, and code Playground

by darxide

HTML

<table>
	<tr>
		<td><input type="checkbox"></td>
		<td><input type="checkbox"></td>
		<td><input type="checkbox"></td>

	</tr>
		<tr>
		<td><input type="checkbox"></td>
		<td><input type="checkbox"></td>
		<td><input type="checkbox"></td>

	</tr>
</table>

CSS

td{border:1px solid #666;}

JavaScript

$('body').on('change' , 'tr input' , function () {

	var count_checked = 0;

	$(this).parent().parent().find('input:checked').each(function() {
		count_checked++
	})

	if(count_checked > 0){
		$(this).parent().parent().find('input').each(function () {
			$(this).prop('disabled' , true)
		})
		$(this).removeAttr('disabled')
	} else {
		$(this).parent().parent().find("input").removeAttr('disabled')
	}
})