<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>json导出Excel</title>
<script type="text/javascript" src="JsonExportExcel.js"></script>
<script>
window.onload=function () {
var option={};
option.fileName = 'excel'
option.datas=[
{
sheetData:[{one:'一行一列',two:'一行二列'},{one:'二行一列',two:'二行二列'}],
sheetName:'sheet',
sheetFilter:['two','one'],
sheetHeader:['第一列','第二列'],
},
{
sheetData:[{one:'一行一列',two:'一行二列'},{one:'二行一列',two:'二行二列'}]
}
];
var toExcel=new ExportJsonExcel(option);
toExcel.saveExcel();
};
</script>
</head>
<body>
</html>
来源:https://github.com/cuikangjie/JsonExportExceljs地址https://raw.githubusercontent.com/cuikangjie/JsonExportExcel/master/dist/JsonExportExcel.min.js