設置單元格對齊方式在python中如何操作?
提問人:楊紫紅發(fā)布時間:2020-11-18
alignment = xlwt.Alignment() #創(chuàng)建alignment
alignment.horz = xlwt.Alignment.HORZ_CENTER #設置水平對齊為居中,May be: HORZ_GENERAL, HORZ_LEFT, HORZ_CENTER, HORZ_RIGHT, HORZ_FILLED, HORZ_JUSTIFIED, HORZ_CENTER_ACROSS_SEL, HORZ_DISTRIBUTED
alignment.vert = xlwt.Alignment.VERT_CENTER #設置垂直對齊為居中,May be: VERT_TOP, VERT_CENTER, VERT_BOTTOM, VERT_JUSTIFIED, VERT_DISTRIBUTED
style3.alignment = alignment #應用alignment到style3上
繼續(xù)查找其他問題的答案?
相關視頻回答
點擊加載更多評論>>