(function(a){a.fn.extend({tableExport:function(g){var n={separator:",",ignoreColumn:[],tableName:"yourTableName",type:"csv",pdfFontSize:14,pdfLeftMargin:20,escape:"true",htmlContent:"false",consoleLog:"false"};var g=a.extend(n,g);var d=this;if(n.type=="csv"||n.type=="txt"){var f="";a(d).find("thead").find("tr").each(function(){f+="\n";a(this).filter(":visible").find("th").each(function(t,u){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(t)==-1){f+='"'+k(a(this))+'"'+n.separator}}});f=a.trim(f);f=a.trim(f).substring(0,f.length-1)});a(d).find("tbody").find("tr").each(function(){f+="\n";a(this).filter(":visible").find("td").each(function(t,u){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(t)==-1){f+='"'+k(a(this))+'"'+n.separator}}});f=a.trim(f).substring(0,f.length-1)});if(n.consoleLog=="true"){console.log(f)}var c="base64,"+a.base64.encode(f);window.open("data:application/"+n.type+";filename=exportData;"+c)}else{if(n.type=="sql"){var f="INSERT INTO `"+n.tableName+"` (";a(d).find("thead").find("tr").each(function(){a(this).filter(":visible").find("th").each(function(t,u){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(t)==-1){f+="`"+k(a(this))+"`,"}}});f=a.trim(f);f=a.trim(f).substring(0,f.length-1)});f+=") VALUES ";a(d).find("tbody").find("tr").each(function(){f+="(";a(this).filter(":visible").find("td").each(function(t,u){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(t)==-1){f+='"'+k(a(this))+'",'}}});f=a.trim(f).substring(0,f.length-1);f+="),"});f=a.trim(f).substring(0,f.length-1);f+=";";if(n.consoleLog=="true"){console.log(f)}var c="base64,"+a.base64.encode(f);window.open("data:application/sql;filename=exportData;"+c)}else{if(n.type=="json"){var e=[];a(d).find("thead").find("tr").each(function(){var u="";var t=[];a(this).filter(":visible").find("th").each(function(v,w){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(v)==-1){t.push(k(a(this)))}}});e.push(t)});var o=[];a(d).find("tbody").find("tr").each(function(){var u="";var t=[];a(this).filter(":visible").find("td").each(function(v,w){if(a(this).css("display")!="none"){if(n.ignoreColumn.indexOf(v)==-1){t.push(k(a(this)))}}});o.push(t)});var q=[];q.push({header:e,data:o});if(n.consoleLog=="true"){console.log(JSON.stringify(q))}var c="base64,"+a.base64.encode(JSON.stringify(q));window.open("data:application/json;filename=exportData;"+c)}else{if(n.type=="xml"){var h='';h+="
"+k(a(this))+" | "}}});b+="
"+k(a(this))+" | "}}t++});m++;b+="