Answer the question
In order to leave comments, you need to log in
How to calculate excel cell width and height in pixels?
The column width is specified in characters, while the size in pixels depends on the selected font.
How to get cell width and height value in pixels?
I use openpyxl, python
_____________________________
Found this calculation: pixels = points * DPI / 72 -> font 12pt * 96dpi / 72 = 16px.
That is, if the cell width is set to 1, then it should be 16px in pixels, but in fact 13px.
As I understand it, the width is set in the number of characters, but if you set the width to 2, then the pixels will be not 26, but 21px.
It turns out that one character occupies 8 pixels.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question