JS
$('#type-activity-table-id').on('click', function(event){
let target = event.target;
console.log(target);
if(target.nodeName != 'TH') return false;
let index = target.cellIndex;
let type = target.getAttribute('data-type');
colIndex = (colIndex == index) ? -1 : index;
tableSort(index, type, colIndex == index);
})