javascript - remove hidden table rows and output .html to excel -


i'm trying remove <thead> , table rows :hidden, output rest excel sheet... problem it's not removing rows, hides them. when view outputted excel sheet, rows hidden don't want...i want them removed don't show in excel output @ all.

i in 1 line if possible...right i'm trying:

var body = $(tableelm).remove("thead").remove("tbody:hidden").html(); 

i've tried other ways so:

var clone = $(tableelm + " tbody:visible").clone(); var body = clone.html(); 

but tries same result: rows hidden -- not removed wish.

the following should work. delete document hidden elements inside table

$('table *:hidden').remove(); var cloneditem = $($('table').html()); 

this option in 'identify' elements deleted can delete them later in cloneditem

$('table *:hidden').attr('data-todelete', 'true'); var cloneditem = $($('table').html()); $('table *:hidden').removeattr('data-todelete'); cloneditem.find('*:hidden').remove(); 

Comments