Python- Excel table set font color and background color

Recent beautification Excel style in learning python, hoping to turn the test report look better

1. Set font color: font.colour_index

Example:

font2.colour_index = 2 #设置字体颜色为红色

2. Set background color: pattern.pattern_fore_color

Example:

pattern.pattern_fore_colour = 48 #设置背景颜色为蓝色

Color attached tableHere Insert Picture Description

Published 11 original articles · won praise 0 · Views 254

Guess you like

Origin blog.csdn.net/zkw_1998/article/details/103930052
Recommended