// 导出单个sheet excel
export const exportSingleSheet = function(tableSelector, fileName) {
var excelContent = document.getElementById(tableSelector).innerHTML;
var excelFile =
"<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>";
excelFile +=
"<head>" +
"<!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>sheet</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->" +
"<style>" +
".no-border{" +
"border:none;" +
"}" +
"td,tr {" +
" text-align: center;" +
html table导出为excel
最新推荐文章于 2024-05-16 18:15:52 发布