Python and openpyxl - Changing column width to match?

Say I had a workbook, and I wanted to make sure all the columns were readable; how would I determine the column width, which should be from the cell text, and then change the column width?

+4
source share
1 answer

You cannot do it for sure: the width of the columns is calculated using the font installed on the computer system, with some additions. This way you can only work with the best guess.

You can set an attribute bestFitfor a column, but that often does not do what you expect.

From the specification of ยง 18.3.1.13:

" " true:

  • , AND
  • " " , , , " ", , .
+2

Source: https://habr.com/ru/post/1618220/


All Articles