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?
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"
You can use row_dimensions or column_dimensions property to set height or width:
# set the height of the row
sheet.row_dimensions[1].height = 20
# set the width of the column
sheet.column_dimensions['B'].width = 20
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With