Pure javascript html table to Excel exporter
Load table2excel.min.js in the project header:
<script type="text/javascript" src="table2excel.min.js"></script>
Create and object obj of Table2Excel(element, options) then call obj.export()
elementis an elementidorclass.optionis a configuration that includes:exluderows with a given givenclassis skiped during the export.filenameis a exported file name.
see the below example that exports a <table id="tbl">
let t2e = new Table2Excel('#tbl', {
exclude: "",
filename: 'file-name'
});
t2e.export();