https://github.com/sheetjs/js-xlsx 上面有很多例子,angular,jquery等也可以和https://github.com/agershun/alasql 结合使用
var elt = document.getElementById('data-table');
var wb = XLSX.utils.table_to_book(elt, {sheet:"Sheet JS"});
XLSX.write(wb, {bookType:type, bookSST:true, type: 'base64'}) :
XLSX.writeFile(wb, test.xlsx);
https://github.com/agershun/alasql
https://github.com/agershun/alasql/wiki/How-to-hide-HTML-columns-when-exporting-to-Excel