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()
element
is an elementid
orclass
.option
is a configuration that includes:exlude
rows with a given givenclass
is skiped during the export.filename
is 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();