我有一个表格,我绘制单元格我也有过滤器,我有一个样式的标题。现在,当我想导出到excel时,它没有按照我的表的风格来做,有人知道怎么做吗?
事先我感谢你的帮助!
答案 0 :(得分:0)
您可以使用excelExport事件手动更改单元格的颜色。
示例:强>
excelExport: function(e) {
var sheet = e.workbook.sheets[0];
for (var rowIndex = 1; rowIndex < sheet.rows.length; rowIndex++) {
if (rowIndex % 2 == 0) {
var row = sheet.rows[rowIndex];
for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex ++) {
row.cells[cellIndex].background = "#aabbcc";
}
}
}