OpenPyXL自动高度行 [英] Openpyxl auto-height row
本文介绍了OpenPyXL自动高度行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试设置自动换行.但是当我使用自动换行时不会自动更改高度.如何设置自动高度行?
I'm trying to set wrap text. But when i using wrap text row doesn't change height automatically. How can I set auto-height row?
推荐答案
您需要查看相关行的RowDimension
对象,尤其是height属性:
You need to look at the RowDimension
object for the relevant row, specifically the height attribute:
rd = ws.row_dimensions[3] # get dimension for row 3
rd.height = 25 # value in points, there is no "auto"
这篇关于OpenPyXL自动高度行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文