good day, I need help, I want to generate an xls file but I do not need one of the columns. Any way to do it?
<script>
function ExportToExcel(htmlExport) {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
//other browser not tested on IE 11
// If Internet Explorer
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
jQuery('body').append(" <iframe id=\"iframeExport\" style=\"display:none\"></iframe>");
iframeExport.document.open("txt/html", "replace");
iframeExport.document.write(htmlExport);
iframeExport.document.close();
iframeExport.focus();
sa = iframeExport.document.execCommand("SaveAs", true, "List.xls");
}
else {
var link = document.createElement('a');
document.body.appendChild(link); // Firefox requires the link to be in the body
link.download = "List.xls";
link.href = 'data:application/vnd.ms-excel,' + escape(htmlExport);
link.click();
document.body.removeChild(link);
}
}
</script>
<HTML>
<head>
<script src="../ace_template/components/jquery/dist/jquery.js"></script>
</head>
<body>
<table id="tabla">
<tr>
<td>Campo 1.1</td>
<td>Campo 1.2</td>
<td>Campo 1.3</td>
<td>Campo 1.4</td>
<td>Campo 1.5</td>
</tr>
<tr>
<td>Campo 2.1</td>
<td>Campo 2.2</td>
<td>Campo 2.3</td>
<td>Campo 2.4</td>
<td>Campo 2.5</td>
</tr>
</table>
<input type="button" name="btnExportar" id="btnExportar" value="Exportar a Excel" onclick="ExportToExcel(jQuery('#tabla').prop('outerHTML'));"
/>
</body>
</HTML>
I have this code but it does not work as I need it