1

how to remove tr in a table which is display:none in CSS

  • 4
    I'm voting to close this question as off-topic because its related Jquery. – Jai Nov 30 '18 at 4:51
2

You can remove all tr which is having style="display: none;" by following jQuery code:

jQuery( document ).ready(function() {
    jQuery( "tr" ).each(function( index ) {
        if (jQuery( this ).css('display') == 'none'){
            jQuery(this).remove();
        }
    });
});

Description: Above code will check for style="display: none; for each tr element, if found it will remove. If you want to remove tr for specific table, You can use table class in code hierarchy

A working demo at JSfiddle

Hope above will help!

Not the answer you're looking for? Browse other questions tagged or ask your own question.