我正在尝试设置换行文本。但是当我使用换行时,文本行不会自动改变高度。如何设置自动高行?
发布于 2016-06-18 15:56:09
您需要查看相关行的RowDimension对象,特别是高度属性:
rd = ws.row_dimensions[3] # get dimension for row 3
rd.height = 25 # value in points, there is no "auto"发布于 2016-06-25 03:50:00
如果您的数据存储在DataFrame中,我建议您使用StyleFrame。它可以自动调整列宽和行高,也有一些很好的功能。
发布于 2020-07-02 01:03:09
可以使用row_dimensions或column_dimensions属性设置高度或宽度:
# set the height of the row
sheet.row_dimensions[1].height = 20
# set the width of the column
sheet.column_dimensions['B'].width = 20https://stackoverflow.com/questions/37891149
复制相似问题