0
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 this column, I know that this example below hides the column position 5, but how to go through 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();
});
Hello @Felipe Duarte works, but the button
btnBuscar
makes asubmit
inview
in order to load the data from the Client, however the function that hides the columns is executed before, that is to say me occult and in the sequence is made a refresh in the table, because I use the same button that makes Submit I need to hide the columns after the table has been fully loaded, there is a way around it ?– hard123
solved, put the code at the end of the script and worked!
– hard123
another question related to this post occurred to me and if you can assist me I thank you (https://answall.com/questions/213481/traver-everyone-table-html-e-occur-caso-somecoluna-5-seja-v)
– hard123