let aTag = document.createElement("a");
var html = "<html><head><meta charset='UTF-8'></head><body>"+document.getElementById("表格的id").outerHTML+"</body></html>";
var blob = new Blob([html],{type:"application/vnd.ms-excel"});
aTag.setAttribute("href", URL.createObjectURL(blob));
aTag.setAttribute("download",'download');
aTag.setAttribute("target", "_blank");
aTag.download = '表格的名字.xls'
aTag.click();