The XF Object

class XF

eXtended Formatting information for cells, rows, columns and styles.

  • New in version 0.6.1

Each of the 6 flags below describes the validity of a specific group of attributes.

In cell XFs, flag==0 means the attributes of the parent style XF are used, (but only if the attributes are valid there); flag==1 means the attributes of this XF are used.

In style XFs, flag==0 means the attribute setting is valid; flag==1 means the attribute should be ignored.

Note that the API provides both “raw” XFs and “computed” XFs – in the latter case, cell XFs have had the above inheritance mechanism applied.

XF._alignment_flag
XF._background_flag
XF._border_flag
XF._font_flag
XF._format_flag
XF._protection_flag
XF.alignment

An instance of an XFAlignment object.

XF.background

An instance of an XFBackground object.

XF.border

An instance of an XFBorder object.

XF.font_index

Index into Book.font_list

XF.format_key

Key into Book.format_map

Warning

OOo docs on the XF record call this “Index to FORMAT record”. It is not an index in the Python sense. It is a key to a map. It is true only for Excel 4.0 and earlier files that the key into format_map from an XF instance is the same as the index into format_list, and only if the index is less than 164.

XF.is_style

0 = cell XF, 1 = style XF

XF.parent_style_index

cell XF: Index into Book.xf_list of this XF’s style XF

style XF: 0xFFF

XF.protection

An instance of an XFProtection object.

XF.xf_index

Index into Book.xf_list

Previous topic

The Sheet Object

Next topic

The XFAlignment Object

This Page