EVOLUTION-NINJA
Edit File: jquery.table2excel.js
!function(e,t,n,a){var l="table2excel",i={exclude:".noExl",name:"Table2Excel"};function o(t,n){this.element=t,this.settings=e.extend({},i,n),this._defaults=i,this._name=l,this.init()}function s(e){return e.filename?e.filename:"table2excel"}o.prototype={init:function(){var t=this;t.template={head:'<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8"><head>\x3c!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets>',sheet:{head:"<x:ExcelWorksheet><x:Name>",tail:"</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>"},mid:"</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--\x3e</head><body>",table:{head:"<table>",tail:"</table>"},foot:"</body></html>"},t.tableRows=[],e(t.element).each(function(n,a){var l,i="";e(a).find("tr").not(t.settings.exclude).each(function(n,a){i+="<tr>",e(a).find("td,th").not(t.settings.exclude).each(function(n,a){e(a).find(t.settings.exclude).length>=1?i+="<td> </td>":i+="<td>"+e(a).html()+"</td>"}),i+="</tr>"}),t.settings.exclude_img&&(l=/(\s+alt\s*=\s*"([^"]*)"|\s+alt\s*=\s*'([^']*)')/i,i=i.replace(/<img[^>]*>/gi,function(e){var t=l.exec(e);return null!==t&&t.length>=2?t[2]:""})),t.settings.exclude_links&&(i=function(e){return e.replace(/<a[^>]*>|<\/a>/gi,"")}(i)),t.settings.exclude_inputs&&(i=function(e){var t=/(\s+value\s*=\s*"([^"]*)"|\s+value\s*=\s*'([^']*)')/i;return e.replace(/<input[^>]*>|<\/input>/gi,function(e){var n=t.exec(e);return null!==n&&n.length>=2?n[2]:""})}(i)),t.tableRows.push(i)}),t.tableToExcel(t.tableRows,t.settings.name,t.settings.sheetName)},tableToExcel:function(a,l,i){var o,c,r,m=this,x="";if(m.format=function(e,t){return e.replace(/{(\w+)}/g,function(e,n){return t[n]})},i=void 0===i?"Sheet":i,m.ctx={worksheet:l||"Worksheet",table:a,sheetName:i},x=m.template.head,e.isArray(a))for(o in a)x+=m.template.sheet.head+i+o+m.template.sheet.tail;if(x+=m.template.mid,e.isArray(a))for(o in a)x+=m.template.table.head+"{table"+o+"}"+m.template.table.tail;for(o in x+=m.template.foot,a)m.ctx["table"+o]=a[o];if(delete m.ctx.table,!!n.documentMode)if("undefined"!=typeof Blob){x=[x=m.format(x,m.ctx)];var d=new Blob(x,{type:"text/html"});t.navigator.msSaveBlob(d,s(m.settings))}else txtArea1.document.open("text/html","replace"),txtArea1.document.write(m.format(x,m.ctx)),txtArea1.document.close(),txtArea1.focus(),sa=txtArea1.document.execCommand("SaveAs",!0,s(m.settings));else{var u=new Blob([m.format(x,m.ctx)],{type:"application/vnd.ms-excel"});t.URL=t.URL||t.webkitURL,c=t.URL.createObjectURL(u),(r=n.createElement("a")).download=s(m.settings),r.href=c,n.body.appendChild(r),r.click(),n.body.removeChild(r)}return!0}},e.fn[l]=function(t){var n=this;return n.each(function(){e.data(n,"plugin_"+l)||e.data(n,"plugin_"+l,new o(this,t))}),n}}(jQuery,window,document);