Openpyxl:如何使用 write_only 单元格和工作簿更改行高
Openpyxl: how change row height with write_only cells and workbook
我需要以只写模式创建 xls 文件并自定义行高。但如果我使用 write_only=True.
,行高默认保持不变
row = []
book = Workbook(write_only=True)
sheet = book.create_sheet()
cell_1 = WriteOnlyCell(sheet)
# styling and filling cell data
row.append(cell_1)
cell_2 = WriteOnlyCell(sheet)
# styling and filling cell data
row.append(cell_2)
sheet.append(row)
sheet.row_dimensions[len(sheet.rows)].height = 30
没有 write_only 一切正常。
行和列维度在只写模式下不可用。
必须在添加任何单元格之前完成。请参阅 openpyxl.readthedocs.io/en/latest/optimized.html
底部的警告部分
我需要以只写模式创建 xls 文件并自定义行高。但如果我使用 write_only=True.
,行高默认保持不变row = []
book = Workbook(write_only=True)
sheet = book.create_sheet()
cell_1 = WriteOnlyCell(sheet)
# styling and filling cell data
row.append(cell_1)
cell_2 = WriteOnlyCell(sheet)
# styling and filling cell data
row.append(cell_2)
sheet.append(row)
sheet.row_dimensions[len(sheet.rows)].height = 30
没有 write_only 一切正常。
行和列维度在只写模式下不可用。
必须在添加任何单元格之前完成。请参阅 openpyxl.readthedocs.io/en/latest/optimized.html
底部的警告部分