再将模板赋予需要更改样式的单元格
from openpyxl.styles import *
#先设置表格的样式模板,再将模板赋予需要更改样式的单元格
#设置样式模板,这里只列举一部分常用的样式
#...= Border(top=thin, left=thin, right=thin, bottom=thin)
#设置字体样式,设置字体为 微软雅黑,单下划线,颜色为蓝色,字体加粗
yahei_font_u...= Font(name=u'微软雅黑',underline='single',color='0000FF',bold=True)
#设置背景颜色,设置充满方式为充满,颜色为黄色
yellow_fill...=u'微软雅黑',bold=True)
# 设置链接字体样式,设置字体为 微软雅黑,单下划线,颜色为蓝色
self.yahei_u = Font(name=u'微软雅黑...', underline='single', color='0000FF')
# 设置背景颜色,设置充满方式为充满,颜色为黄色
self.yellow_fill = PatternFill