Quote:
i am trying this code but it gives all column in xls. can someone suggest me a solution to export only selected columns..
That is because you are passing down the entire HTML tree to be saved,
new Blob([document.getElementById('exportable').innerHTML], {
A solution for this would be that you first filter the content and then pass it down. You can iterate over the collection and then remove the elements where the
display
property in
style
attribute is
none
.
Maybe a quick jQuery can help you here, this Stack Overflow thread shares a similar code for jQuery,
attributes - jQuery get elements without display="none" - Stack Overflow[
^].