How can I hide the column with all empty cells including the title <th>
in that column, while leaving the other columns and their titles as it is. Following jquery hides the entire <th>
, which is not I want. Here is a sample, where I want to hide only the entire 'Column3' including <th>
. Many thanks in advance.
$('table#mytable tr').each(function() {
if ($(this).children('td:empty').length === $(this).children('td').length) {
$(this).hide();
}
});