Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 5, 2019 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/f54253817267157b713e7ad5b9719690 to your computer and use it in GitHub Desktop.
Save parzibyte/f54253817267157b713e7ad5b9719690 to your computer and use it in GitHub Desktop.
const $btnExportar = document.querySelector("#btnExportar"),
$tabla = document.querySelector("#tabla");
$btnExportar.addEventListener("click", function() {
let tableExport = new TableExport($tabla, {
exportButtons: false, // No queremos botones
filename: "Mi tabla de Excel", //Nombre del archivo de Excel
sheetname: "Mi tabla de Excel", //Título de la hoja
});
let datos = tableExport.getExportData();
let preferenciasDocumento = datos.tabla.xlsx;
tableExport.export2file(preferenciasDocumento.data, preferenciasDocumento.mimeType, preferenciasDocumento.filename, preferenciasDocumento.fileExtension, preferenciasDocumento.merges, preferenciasDocumento.RTL, preferenciasDocumento.sheetname);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment