parent
17de406a58
commit
57d9a5d6f0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,13 @@
|
||||
from openpyxl import load_workbook
|
||||
from openpyxl.styles import *
|
||||
|
||||
def style(file):
|
||||
wb = load_workbook(file)
|
||||
ws = wb.active
|
||||
for row in ws.iter_rows():
|
||||
for cell in row:
|
||||
if cell is not None:
|
||||
cell.alignment = Alignment(horizontal='center',vertical='center')
|
||||
wb.save(file)
|
||||
|
||||
style('测试3.xlsx')
|
Loading…
Reference in new issue