Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python xlsxwriter change row height for all rows in the sheet

Python xlsxwriter, change row height for all rows in the sheet, following is available but apply to single row

worksheet.set_row(0, 20)  # Set the height of Row 1 to 20.

Want to change height of all the rows sheet.

like image 494
Snehal Parmar Avatar asked Mar 19 '16 10:03

Snehal Parmar


1 Answers

To set the height of all rows in XlsxWriter, efficiently*, you can use the set_default_row() method:

worksheet.set_default_row(20)

(*) This is efficient because it uses an Excel optimisation to adjust the row heights with a single XML element. By contrast, using set_row() for each of the ~ 1 million rows would required 1 million XML elements and would lead to a very large file.

like image 137
jmcnamara Avatar answered Oct 17 '22 14:10

jmcnamara