Skip to content
Advertisement

How to dump a dictionary into an .xlsx file with proper column alignment?

I have a dictionary with 2000 items which looks like this:

JavaScript

Given that I want to write it to an .xlsx file, I use this code (taken from here):

JavaScript

This produces an .xlsx file with the following alignment:

JavaScript

However, this is the alignment I am after:

JavaScript

What should I change in the script to achieve this?

Advertisement

Answer

This is what I think should help:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement