openpyxl.formatting.formatting module

class openpyxl.formatting.formatting.ConditionalFormatting(sqref=(), pivot=None, cfRule=(), extLst=None)[源代码]

基类:openpyxl.descriptors.serialisable.Serialisable

cells

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

cfRule

A sequence (list or tuple) that may only contain objects of the declared type

pivot

Values must be of type <class ‘bool’>

rules

Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptve name is desired (eg. “underline” for “u”)

sqref

Values must be of type <class ‘openpyxl.worksheet.cell_range.MultiCellRange’>

tagname = 'conditionalFormatting'
class openpyxl.formatting.formatting.ConditionalFormattingList[源代码]

基类:object

Conditional formatting rules.

add(range_string, cfRule)[源代码]

Add a rule such as ColorScaleRule, FormulaRule or CellIsRule

The priority will be added automatically.