I have a table html with 15 lines and I need to go through all the columns and check if there is any value, if Column is equal to empty then hidden column, this example below hides the position 5 column, but how to traverse the columns?.
$('#btnBuscar').on('click', function () {
//Percorro todas as colunas
//Se coluna vazia então oculto essa coluna
$('.grid td:nth-child(5), th:nth-child(5)').hide();
});