在excel.js中添加标题

问题描述

如何在认行中添加标题?我需要将first(1)行设置为空,并从second(2)行添加列名,该怎么办?

我尝试了以下代码,但是没有用:

const sheetColumns = [];
sheetColumns.push({header: 'Firstname',key: 'fn'});
sheetColumns.push({header: 'Lastname',key: 'ln'});
sheetColumns.push({header: 'Sex',key: 'sex'});

        
workSheet.getRow(2).values = sheetColumns; // this is wrong
//workSheet.columns = sheetColumns; // it not work 

请以正确的方法指导我。预先感谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)