I am trying to create xslx file using excel.js module in node.js. I was able to create the columns and add its values. But, I need to insert some rows before the columns headers, where I can have some descriptions. How can I do that?
Any help will be appreciated
The code I tried is
var worksheet = workbook.getWorksheet(1);
worksheet.mergeCells('A1:B1');
var row = worksheet.getRow(1);
row.getCell(1).value =' Hello, World!';
// ... merged cells are linked
worksheet.getCell('A1').value = 'PI';
worksheet.columns = [
{header: 'Id', key: 'id', width: 10},
{header: 'Name', key: 'name', width: 32},
{header: 'complexity', key: 'complexity', width: 10},
{header: 'hours', key: 'hours', width: 10},
{header: 'cost', key: 'cost', width: 10}
];
worksheet.addRow({name:'m', complexity: 'd', hours:5, cost: 7});