Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert a column in exceljs

I have an existing xlsx file, with 4 columns. [ A, B, C, D ]. I want to insert a new column between A and B to have => [A, B, C, D, E] where B is new and C, D, E are the old [B, C, D]. I haven't found a method in the doc page

Doc : https://github.com/exceljs/exceljs

like image 651
Kalkal Avatar asked Nov 01 '25 15:11

Kalkal


1 Answers

I found the method called "spliceColumns". It works perfectly. For my example => workbook.spliceColumns(2, 0, [])

like image 144
Kalkal Avatar answered Nov 04 '25 03:11

Kalkal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!