我在Angular 4中有一个应用,我想用颜色填充XLSX单元
这是我的下载功能:
downloadXLSX() {
const report = [
['column1', 'column2', 'column3', 'column4'],
['row1val1', 'row1val2', 'row1val3', 'row1val4'],
['row2val1', 'row2val2', 'row2val3', 'row2val4'],
['row3val1', 'row3val2', 'row3val3', 'row3val4']
];
const ws: XLSX.WorkSheet = XLSX.utils.aoa_to_sheet(report );
const wb: XLSX.WorkBook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'sheet');
XLSX.writeFile(wb, 'report.xlsx');
}
结果是:
如何用颜色填充单元格?
我需要这样的东西: