Oct-09-2019, 01:04 PM
(This post was last modified: Oct-09-2019, 01:04 PM by curranjohn46.)
I learned that I did not have the latest openpyxl version. pip install openpyxl installed 2.5. I upgraded it to 3.0.
Now when I look at https://openpyxl.readthedocs.io/en/stable/index.html it makes more sense :-)
I now know that the "Working with Styles" section of the openpyxl 3.0 documentation is the place to go for formatting data.
So I click that, and go to https://openpyxl.readthedocs.io/en/stable/styles.html
That page show me this:
>>> alignment=Alignment(horizontal='general',
... vertical='bottom',
... text_rotation=0,
... wrap_text=False,
... shrink_to_fit=False,
... indent=0)
and I could use that info to wrap text with this line:
Now when I look at https://openpyxl.readthedocs.io/en/stable/index.html it makes more sense :-)
I now know that the "Working with Styles" section of the openpyxl 3.0 documentation is the place to go for formatting data.
So I click that, and go to https://openpyxl.readthedocs.io/en/stable/styles.html
That page show me this:
>>> alignment=Alignment(horizontal='general',
... vertical='bottom',
... text_rotation=0,
... wrap_text=False,
... shrink_to_fit=False,
... indent=0)
and I could use that info to wrap text with this line:
cell.alignment = Alignment(wrapText=True)Now things are starting to make sense for me. :-) Thanks!