问题
How do I change the font size of a cell? I am using OpenPyXL.
It will not let me send this question without typing the above with perfect grammar and spelling, so the last few words people should know what I mean.
回答1:
This works for me:
from openpyxl.styles import Font
fontStyle = Font(size = "10")
ws.cell(row = 1, column = 1, value = 'Test Text').font = fontStyle
I'm using openpyxl version: 2.3.2
回答2:
Openpyxl styling can achieve this for you!
cell.style.font.size = "font size goes here as integer"
来源:https://stackoverflow.com/questions/49156578/how-to-change-font-size-in-python-openpyxl