CellStyle API¶
CellStyle 类API参考文档。
类定义¶
主要方法¶
set_font(...)¶
设置字体。
参数:
- name (str): 字体名称
- size (float): 字体大小
- bold (bool): 是否粗体
- italic (bool): 是否斜体
- color (str | Color): 字体颜色
set_fill(...)¶
设置填充。
set_border(...)¶
设置边框。
set_alignment(...)¶
设置对齐。
apply_to_cell(cell)¶
应用样式到单元格。
示例¶
from symphra_excel.styles import CellStyle
style = CellStyle()
style.set_font(name="Arial", size=12, bold=True)
style.set_background_color("#FFFF00")