Apply format to a cell after being written in XlsxWriter

后端 未结 4 1628
野趣味
野趣味 2020-12-05 17:28

I work on python using XlsxWriter and I\'ve been trying to solve this problem with no success:

My app must create an Xlsx file in which data is shown in a table-like

4条回答
  •  -上瘾入骨i
    2020-12-05 18:10

    you could set the default format of the workbook:

    import xlsxwriter
    workbook = xlsxwriter.Workbook('example.xlsx')
    
    # default cell format to size 10 
    workbook.formats[0].set_font_size(10)
    # default cell format to center
    workbook.formats[0].set_align('center')
    ...
    

提交回复
热议问题