Skip to content Skip to sidebar Skip to footer

Html Tag Removing When Export To Excel

I am using this script to export html table to excel file but I have image tag in table so I want to remove that tag when script export to excel. Here is the script I am using <

Solution 1:

You can remove <img> tags like this:

table: table.innerHTML.replace(/<\s*img[^>]*>/gi,'');

DEMO

Solution 2:

$("#btnExport").click(function(e) {
   window.open('data:application/vnd.ms-excel,' + encodeURIComponent($('#export').html()));
});

Post a Comment for "Html Tag Removing When Export To Excel"