[Table of Contents] [docx version]

SpreadsheetML Reference Material - Table of Contents

cellStyleXfs (Formatting Records)

This element contains the master formatting records (xf's) which define the formatting for all named cell styles in this workbook. Master formatting records reference individual elements of formatting (e.g., number format, font definitions, cell fills, etc) by specifying a zero-based index into those collections. Master formatting records also specify whether to apply or ignore particular aspects of formatting, for example whether to apply a border or not.

A cell can have both direct formatting (e.g., bold) and a cell style (e.g., Explanatory) applied to it. Therefore, both the cell style xf records and cell xf records must be read to understand the full set of formatting applied to a cell.

[Example: This example shows 4 master formatting records, each defining formatting for a named cell style (expressed in the cellStyles collection). Note that 0th record does not express any "apply" attributes, while the other records do express "apply" attribute values. For example, the last record specifies that number format, alignment, and protection formatting will not be applied to the cell, even when that information is specified in related formatting records.

<cellStyleXfs count="4">
<xf numFmtId="0" fontId="0" fillId="0" borderId="0"/>

<xf numFmtId="0" fontId="2" fillId="0" borderId="0" applyNumberFormat="0"
applyFill="0" applyBorder="0" applyAlignment="0" applyProtection="0"/>

<xf numFmtId="0" fontId="3" fillId="0" borderId="1" applyNumberFormat="0"
applyFill="0" applyAlignment="0" applyProtection="0"/>

<xf numFmtId="0" fontId="4" fillId="2" borderId="2" applyNumberFormat="0"
applyAlignment="0" applyProtection="0"/>
</cellStyleXfs>

end example]

Parent Elements

styleSheet3.8.39)

 

Child Elements

Subclause

xf (Format)

§3.8.45

 

Attributes

Description

count (Style Count)

Count of cell style (xf) elements.

 

The possible values for this attribute are defined by the XML Schema unsignedInt datatype.

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_CellStyleXfs">

   <sequence>

   <element name="xf" type="CT_Xf" minOccurs="1" maxOccurs="unbounded"/>

   </sequence>

   <attribute name="count" type="xsd:unsignedInt" use="optional"/>

</complexType>