I need to remove all empty td cells, can I do this with jQuery.
<td></td>
if(td == empty){
$("td").remove();
}
I'm not sure how to write what I'm trying to do.
This is the way to go: {pseudo class empty}
$("td:empty").remove();
To remove all empty td
$('td').each(function() {
if ($(this).html() == '') {
$(this).remove();
}
}
You can use .each()
$("td").each(function() {
if ($(this).html() == "") {
$(this).remove();
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With