openpyxl 统一表格样式

  #  统一表格样式
    rows = ws.max_row
    columns = ws.max_column
    # print(rows)
    # print(columns)
    for row in range(1, rows+1):
        for column in range(1, columns+1):
            ws.cell(row=row, column=column).border = border_set
            if row == 1:
                ws.cell(row=row, column=column).fill = fill

 

posted @ 2020-07-10 09:49  胸怀丶若谷  阅读(652)  评论(0编辑  收藏  举报