I am using js-xlsx
to create an excel file. After doing .json_to_sheet
I am getting my sheet not with the wanted columns order. for example, I am getting the following order:
100 | 200 | 300| 400| a | b | c
when 100, 200, 300, 400, a, b, c
are my columns header.
I what to get the following order:
a | b | c | 100 | 200 | 300| 400
when a | b | c
are always constant and the number of the other columns are changing.
How can I rearrange the columns order?
NOTE:
When used numbers as header the xlsx
rearrange the columns such that the headers start whit numbers are first and then all the rest. When the headers don't start with numbers you can just order the columns in the JSON
you save.
One solution is to add a space ' '
before the number and it fixes the problem. but I don't want a space before the number.
I found this on github issue #738 Check if you can make something out of this. (Something with the 'header' part)