All cell formatting lives in one part, normally xl/styles.xml, whose
root is styleSheet. A cell’s s attribute is a zero-based
index into its cellXfs list (see cells),
and each of those cell formats in turn points by index into the font, fill and border
lists and by id to a number format. The element and attribute definitions here are
those of ECMA-376 1st edition, Part 4, section 3.8 (section 18.8 in later editions and
ISO/IEC 29500), read in the HTML rendering of the standard published by docx4java;
Boolean attributes are XML Schema booleans (true/false or
1/0).
styleSheet
The children come in this order, each optional and at most once (3.8.39):
| Child | Holds |
|---|---|
numFmts | Custom number formats. |
fonts | Fonts. |
fills | Fills. |
borders | Borders. |
cellStyleXfs | xf records of the named cell styles. |
cellXfs | xf records that cells use. |
cellStyles | Named cell styles. |
dxfs | Differential formats for conditional formatting, tables and so on. |
tableStyles | Table and PivotTable styles. |
colors | A replacement indexed palette and recently used colours. |
extLst | Extensions added by later versions. |
Each list element (numFmts, fonts, fills,
borders, cellStyleXfs, cellXfs,
cellStyles, dxfs, tableStyles) has an optional
count attribute, the number of children.
numFmt
Two required attributes (3.8.30): numFmtId, the id that
xf records use, and formatCode, the format string. Ids
below 164 are the built-in
formats, which are not written out; custom formats take ids from 164. A
numFmt may also appear inside a dxf. The syntax of the format string
(sections, symbols, colours, conditions, date and time codes: 18.8.31) and the rules of the
General format (18.8.30) are on the Cells page, in
Format code syntax and
The General format.
font
A font (3.8.21) has no attributes. Its children may appear in any order,
each at most once; a missing child means the default. Most are on/off properties with
a single val attribute, an optional Boolean that defaults to
true, so <b/> means bold.
| Child | val | Meaning |
|---|---|---|
name | string | Font name, such as Calibri. |
charset | integer 0–255 | Character set: 0 ANSI, 1 default, 2 symbol, 77 Mac, 128 Shift-JIS, 129 Hangul, 130 Johab, 134 GB2312, 136 Big5, 161 Greek, 162 Turkish, 163 Vietnamese, 177 Hebrew, 178 Arabic, 186 Baltic, 204 Russian, 222 Thai, 238 Eastern European, 255 OEM (depends on the system). The standard says the list is not exhaustive. |
family | integer 0–255 | Font family: 0 not applicable, 1 Roman, 2 Swiss, 3 Modern, 4 Script, 5 Decorative. |
b | Boolean | Bold. |
i | Boolean | Italic. |
strike | Boolean | Strikethrough. |
outline | Boolean | Draw only the outline of each character. |
shadow | Boolean | Shadow behind, below and to the right (a Macintosh setting that applications may ignore). |
condense | Boolean | Squeeze characters together (Macintosh compatibility; may be ignored). |
extend | Boolean | Stretch the text (compatibility with older applications). |
color | – | Text colour, a colour element. |
sz | double, required | Size in points. |
u | single (default when val is omitted), double, singleAccounting, doubleAccounting, none | Underline. The plain forms cross the descenders of letters such as g and p; the accounting forms sit below them. |
vertAlign | baseline, superscript, subscript (required) | Raised or lowered text, which also uses a smaller size when one is available. |
scheme | major, minor, none (required) | Whether the font is the theme’s major (headings) or minor (body) font. |
fill
A fill (3.8.19) holds exactly one of patternFill or
gradientFill.
patternFill
Attribute patternType (3.8.32; no pattern when absent), then optional
children fgColor and bgColor, both colour
elements. A solid fill uses only the foreground colour. The pattern
types: none (no fill, colours ignored), solid,
mediumGray, darkGray, lightGray,
darkHorizontal, darkVertical, darkDown,
darkUp, darkGrid, darkTrellis,
lightHorizontal, lightVertical, lightDown,
lightUp, lightGrid, lightTrellis,
gray125 (12.5% grey) and gray0625 (6.25% grey)
(ST_PatternType, 3.18.57).
gradientFill
| Attribute | Default | Meaning |
|---|---|---|
type | linear | linear: the colour changes along a line; path: it changes outward from the rectangle given by left, right, top and bottom. |
degree | 0 | Angle of a linear gradient: 0 and 180 vertical, 90 and 270 horizontal, 45, 135, 225 and 315 diagonal. |
left, right, top, bottom | 0 | For a path gradient, the edges of the inner rectangle as fractions 0 to 1 of the cell. |
Its children are stop elements (3.8.38), each with a required
position (a double, read like the edge values) and exactly one
color.
border
A border (3.8.4) holds, in this order and each optional,
left, right, top, bottom,
diagonal, vertical and horizontal
(the last two are the inside borders of a range, used in differential formats). Each
edge has a style attribute (default none) and an optional
color child; with no colour, automatic is meant. The
border itself has:
| Attribute | Default | Meaning |
|---|---|---|
diagonalDown | – | Draw the diagonal from top left to bottom right. |
diagonalUp | – | Draw the diagonal from bottom left to top right. |
outline | true | Apply left, right, top and bottom only to the outside edges of a range. |
Border styles (ST_BorderStyle, 3.18.3): none, thin,
medium, dashed, dotted, thick,
double, hair, mediumDashed,
dashDot, mediumDashDot, dashDotDot,
mediumDashDotDot, slantDashDot. These are the same
fourteen styles as BIFF8’s
border style codes 0 to 13.
How the viewer paints these cell styles
The sheet table turns each cell’s style into CSS in explorer/components/cellstyle.js
(one function, also run by the test scripts/xlsx/test-cellstyle.mjs, 15 checks).
- Diagonal borders.
diagonalUpis drawn from the bottom left to the top right anddiagonalDownfrom the top left to the bottom right (18.8.4), in the diagonal border’s colour, as a gradient line across the cell. Atruevalue is read as well as1. - Text rotation. 1 to 90 turn the text counter-clockwise (90 reads from the bottom to the top); 91 to 180 turn it clockwise by the value minus 90 (180 reads from the top to the bottom); 255 stacks upright letters (vertical text); 0 is horizontal (18.8.1, [MS-OI29500] 2.1.693).
- Shrink to fit. The text’s font size is scaled down once the cell is in the page until it fits the cell width.
- Line pattern fills. The names of 18.18.55 give direction only (horizontal, vertical, down, up, grid, trellis; light or dark). The viewer draws light as 1 pixel in 4 and dark as 2 pixels in 4 in the foreground colour over the background colour; down runs from the top left to the bottom right. These stripe widths are the viewer’s own choice: the standard does not give them.
Check. A 31-case workbook (samples/xlsx/oracle/cellvisual/cellvisual.xlsx)
was rendered by LibreOffice to PDF and read: the diagonal directions, the rotation directions and angles
and shrinking agree with the above. LibreOffice draws the line patterns as one flat colour mix, so there is
no independent oracle for the stripes. The result was not compared in a browser screenshot.
xf: cell formats
One xf (3.8.45) describes all the formatting of a cell or of a named
style. Children, each optional: alignment, protection,
extLst.
| Attribute | Default | Meaning |
|---|---|---|
numFmtId | – | Number format id. |
fontId | – | Zero-based index into fonts. |
fillId | – | Zero-based index into fills. |
borderId | – | Zero-based index into borders. |
xfId | – | In cellXfs only: zero-based index of the cellStyleXfs record of the cell’s named style. |
applyNumberFormat, applyFont, applyFill, applyBorder, applyAlignment, applyProtection | – | Whether this record’s number format, font, fill, border, alignment or protection is applied. |
quotePrefix | false | The text was typed with a leading apostrophe (which is not stored in the shared strings). |
pivotButton | false | The cell shows a PivotTable drop-down button. |
alignment
| Attribute | Values | Meaning |
|---|---|---|
horizontal | general, left, center, right, fill, justify, centerContinuous, distributed | general puts text left, numbers, dates and times right and Booleans in the centre; fill repeats the value across the cell in whole copies; centerContinuous centres across neighbouring cells with the same format; distributed spreads words across the width, with any indent on both sides (3.18.42). |
vertical | top, center, bottom, justify, distributed | Vertical alignment (3.18.89). |
textRotation | 0–180 | 0–90 degrees upward from horizontal; 91–180 downward, by textRotation − 90 degrees. |
wrapText | Boolean | Wrap text inside the cell. |
indent | unsigned | Indent level; each level is three spaces of the Normal style’s font. Only with left, right and distributed alignment. |
relativeIndent | signed | Indent to add or remove, only in a dxf. |
justifyLastLine | Boolean | Also justify or distribute the last line (East Asian alignment). |
shrinkToFit | Boolean | Shrink the text to fit the column (not with several lines). |
readingOrder | 0, 1, 2 | 0 by context, 1 left to right, 2 right to left. |
protection
Two Boolean attributes (3.8.33), which take effect only when the sheet is protected:
locked (the cell cannot be changed as the sheet’s
sheetProtection says) and hidden (the formula is not shown
in the formula bar; the value still is).
cellStyle: named styles
| Attribute | Meaning |
|---|---|
name | The style name. |
xfId | Required: zero-based index of its record in cellStyleXfs. |
builtinId | For a built-in style, which one (below); the id, not the name, decides. |
iLevel | Outline level, for the RowLevel and ColLevel styles. |
hidden | Not shown in the user interface. |
customBuiltin | A built-in style that has been changed, to be saved even when unused. |
Built-in style ids (3.8.7):
| Id | Style | Id | Style | Id | Style |
|---|---|---|---|---|---|
| 0 | Normal | 20 | Input | 37 | Accent3 |
| 1 | RowLevel_1 to RowLevel_7 (by iLevel) | 21 | Output | 38–40 | 20%, 40%, 60% - Accent3 |
| 2 | ColLevel_1 to ColLevel_7 | 22 | Calculation | 41 | Accent4 |
| 3 | Comma | 23 | Check Cell | 42–44 | 20%, 40%, 60% - Accent4 |
| 4 | Currency | 24 | Linked Cell | 45 | Accent5 |
| 5 | Percent | 25 | Total | 46–48 | 20%, 40%, 60% - Accent5 |
| 6 | Comma [0] | 26 | Good | 49 | Accent6 |
| 7 | Currency [0] | 27 | Bad | 50–52 | 20%, 40%, 60% - Accent6 |
| 8 | Hyperlink | 28 | Neutral | 53 | Explanatory Text |
| 9 | Followed Hyperlink | 29 | Accent1 | ||
| 10 | Note | 30–32 | 20%, 40%, 60% - Accent1 | ||
| 11 | Warning Text | 33 | Accent2 | ||
| 15 | Title | 34–36 | 20%, 40%, 60% - Accent2 | ||
| 16–19 | Heading 1 to Heading 4 |
Ids 12 to 14 are not listed in the standard.
dxf: differential formats
A dxf (3.8.14) holds only what differs from the underlying format:
optional font, numFmt, fill,
alignment, border, protection and
extLst, in that order, with the same content as above. Conditional
formatting rules and table style elements point to them by zero-based index
(dxfId).
Table styles
tableStyles (3.8.42) has count,
defaultTableStyle and defaultPivotStyle (names of the
styles given to new tables and PivotTables) and holds tableStyle
elements. A tableStyle (3.8.40) has a required name,
pivot and table (default true: offered for
PivotTables, for tables, or both) and count, and holds
tableStyleElement elements (3.8.41), each with a required
type, an optional dxfId (the formatting) and
size (default 1: rows or columns per stripe, for the stripe types
only).
Element types (ST_TableStyleType, 3.18.79): wholeTable,
headerRow, totalRow, firstColumn,
lastColumn, firstRowStripe, secondRowStripe,
firstColumnStripe, secondColumnStripe,
firstHeaderCell, lastHeaderCell,
firstTotalCell, lastTotalCell; and for PivotTables
firstSubtotalColumn, secondSubtotalColumn,
thirdSubtotalColumn, firstSubtotalRow,
secondSubtotalRow, thirdSubtotalRow,
blankRow (only with blank rows after each item),
firstColumnSubheading, secondColumnSubheading,
thirdColumnSubheading, firstRowSubheading,
secondRowSubheading, thirdRowSubheading,
pageFieldLabels and pageFieldValues.
Rules (18.8.40, 18.8.41): the table styles of Annex G of the standard (the built-in style names) shall be
supported, and the pivot and table flags are not mutually exclusive. Where several
elements format the same cell, they apply in this order, later ones over earlier ones: for tables
wholeTable, firstColumnStripe, secondColumnStripe,
firstRowStripe, secondRowStripe, lastColumn,
firstColumn, headerRow, totalRow, firstHeaderCell,
lastHeaderCell, firstTotalCell, lastTotalCell; for PivotTables the
order begins wholeTable, pageFieldLabels and continues with the
pivot-only elements.
The viewer paints these styles on the cells of a table (tableStyleInfo) and of a PivotTable
(its pivotTableStyleInfo and location). The built-in styles
(TableStyleLight1 to TableStyleDark11, PivotStyleLight16 and the rest) are not
written into a workbook by Office, so the viewer carries the 144 definitions of
presetTableStyles.xml, the file of Annex G that comes with the standard, unchanged. A style defined in the
workbook's own tableStyles is used when the name matches. The stripes start at the first data row or column
and take the element's size as their length; the inner borders of a style are the horizontal
and vertical edges of its differential format. What the cell's own format sets beyond the default cell format
is kept over the style, and a conditional format is kept over both. Tables with and without a header row, with a totals
row, first and last column and stripes are painted as LibreOffice paints them
(samples/xlsx/tables-styles.xlsx, eight tables compared with its PDF render). LibreOffice paints no PivotTable
styles, so a PivotTable's header, grand total and stripe regions follow the standard's text without a program to
compare against; the page-field, subheading, subtotal and blank-row elements follow the standard's figures, as below.
Where the PivotTable elements lie. In the text of ECMA-376-1 the elements are defined by
one line each (18.18.77 ST_TableStyleType); which cells they cover is shown only in the figures of that section
(printed pages 2487 to 2503, one yellow-marked PivotTable per element), which were rendered from the PDF page by page and
read. The levels come from the items (18.10.1.17 colItems: the r of an i repeats that many labels of the
previous item; t="default" with r="1" is the total of the second field, without r
the total of the first). The placement, as the viewer applies it:
- Whole table also covers the page-field rows, but not the blank row between them and the table.
Page field labels is the first column of the page-field rows, page field values the second
(the rows lie
rowPageCountrows aboveref, with one blank row between; whencolPageCountis more than 1 the figures do not show the arrangement, so nothing is placed). - Subtotal row 1, 2, 3: the whole row of a
t="default"row item of level 0, 1, 2 (r); subtotal column 1, 2, 3: the column of at="default"column item of that level, from the header row of that level down to the last data row; blank row: rows oft="blank"items. - Row subheading 1, 2, 3: the whole row of a label item whose deepest label is the field at level 0, 1, 2 and is not the innermost field (the innermost, leaf rows carry none).
- Column subheading 1, 2, 3: the header row of that level over the columns of the label, up to and including the subtotal column of that label, and that subtotal column down through the remaining header rows.
One detail of the figures is not reproduced and has no rule: in “Column Subheading 2” the leaf header cells
(“No Discount”) under July, August and September are also yellow, in “Column Subheading 3” they are not.
No Excel-written PivotTable could be found as a second source for the colours: an XML file records the layout, never how a style is painted, and
LibreOffice paints no PivotTable styles. The placement therefore rests on the standard's figures alone, checked by
parser-test/test-xlsx-tablestyle.mjs against a PivotTable laid out as the figures are. What Excel-written files do confirm is the geometry of the page fields:
the Open XML SDK files Pivot2.xlsx and Pivot4.xlsx (saved by Excel, MIT) have rowPageCount 1 and colPageCount 1, the page field's label in A1 and value in B1,
an empty row 2 and ref starting in row 3, which is the placement above (parser-test/test-xlsx-pivotpage.mjs, 10 checks). A search for a workbook with
colPageCount greater than 1 (Open XML SDK, ClosedXML, EPPlus, ClosedXML.Report test trees, GitHub code search) found only files with 1 or ones written by a library, so that arrangement is not placed.
Colours
Every colour element (color, fgColor,
bgColor and the border edges’ color) has these optional
attributes; one of the first four says where the colour comes from:
| Attribute | Meaning |
|---|---|
auto | Automatic: the system colour. |
indexed | Index into the indexed palette (below); kept for backward compatibility. |
rgb | Eight hex digits, alpha then red, green and blue (FF0000FF is opaque blue). |
theme | Index into the theme’s colour scheme (clrScheme) in the theme part. |
tint | −1.0 to 1.0, default 0: darken or lighten. The colour is turned into hue, luminance and saturation with a maximum of 255; for a negative tint the luminance becomes L × (1 + tint), for a positive one L × (1 − tint) + (255 − 255 × (1 − tint)). Luminance 100 with tint 0.75 becomes 217. |
colors and the indexed palette
colors (3.8.11) holds an optional indexedColors, written
when the palette has been changed, with one or more rgbColor children
that replace it in order, and an optional mruColors, the recently chosen
custom colours. The default palette (3.8.26), as ARGB:
| Index | ARGB | Index | ARGB | Index | ARGB | Index | ARGB |
|---|---|---|---|---|---|---|---|
| 0 | 00000000 | 17 | 00008000 | 34 | 00FFFF00 | 51 | 00FFCC00 |
| 1 | 00FFFFFF | 18 | 00000080 | 35 | 0000FFFF | 52 | 00FF9900 |
| 2 | 00FF0000 | 19 | 00808000 | 36 | 00800080 | 53 | 00FF6600 |
| 3 | 0000FF00 | 20 | 00800080 | 37 | 00800000 | 54 | 00666699 |
| 4 | 000000FF | 21 | 00008080 | 38 | 00008080 | 55 | 00969696 |
| 5 | 00FFFF00 | 22 | 00C0C0C0 | 39 | 000000FF | 56 | 00003366 |
| 6 | 00FF00FF | 23 | 00808080 | 40 | 0000CCFF | 57 | 00339966 |
| 7 | 0000FFFF | 24 | 009999FF | 41 | 00CCFFFF | 58 | 00003300 |
| 8 | 00000000 | 25 | 00993366 | 42 | 00CCFFCC | 59 | 00333300 |
| 9 | 00FFFFFF | 26 | 00FFFFCC | 43 | 00FFFF99 | 60 | 00993300 |
| 10 | 00FF0000 | 27 | 00CCFFFF | 44 | 0099CCFF | 61 | 00993366 |
| 11 | 0000FF00 | 28 | 00660066 | 45 | 00FF99CC | 62 | 00333399 |
| 12 | 000000FF | 29 | 00FF8080 | 46 | 00CC99FF | 63 | 00333333 |
| 13 | 00FFFF00 | 30 | 000066CC | 47 | 00FFCC99 | 64 | system foreground |
| 14 | 00FF00FF | 31 | 00CCCCFF | 48 | 003366FF | 65 | system background |
| 15 | 0000FFFF | 32 | 00000080 | 49 | 0033CCCC | ||
| 16 | 00800000 | 33 | 00FF00FF | 50 | 0099CC00 |
Divergence from spec: where Excel differs from the standard
Divergence from spec. The table below is the divergence list of this page; the table-style region question (colPageCount above 1, “No Discount”) is an open gap, described under Table styles, not a divergence. [MS-OI29500] section 2.1 (notes 2.1.693 to 2.1.721) lists how Excel reads and writes the elements of section 18.8 of ISO/IEC 29500 (3.8 in the ECMA-376 1st edition used above). Each point below names the standard’s rule and what Excel does instead.
| Element (18.8) | Standard says | Excel does |
|---|---|---|
alignment (18.8.1, 2.1.693) | Attributes are unsigned integers; no defaults for horizontal, vertical, textRotation, wrapText, indent, relativeIndent, justifyLastLine, shrinkToFit, readingOrder. | textRotation is 0 to 180 or 255 (255 is vertical text); indent is at most 255; readingOrder is 0, 1 or 2. Defaults: horizontal general, vertical bottom, wrapText, justifyLastLine and shrinkToFit false, the rest 0. The viewer applies 0 to 180 and 255 as described under How the viewer paints these cell styles. |
color (18.3.1.15, 2.1.600) | Described for data bars and colour scales only; indexed, tint and theme have only their schema types. | The element is used wherever a colour appears. indexed is at most 255, theme (zero-based) at most 255, tint from -1 to 1. |
fgColor, bgColor (18.8.19, 18.8.3; 2.1.704, 2.1.694) | No priority among the colour attributes. | Priority auto < indexed < rgb < theme; only the highest one present is written back. |
border (18.8.4, 2.1.695) | No defaults for diagonalUp, diagonalDown. | Both default to false. The viewer reads true and 1 alike and draws both diagonals when both are set. |
start, end (18.8.37, 18.8.16; 2.1.715, 2.1.702) | Leading and trailing edge borders are start and end. | Writes left and right instead. |
borders, fills, fonts (18.8.5, 18.8.21, 18.8.23; 2.1.696, 2.1.705, 2.1.707) | 0 to unbounded children. | 1 to 65430 borders and fills; 1 to 65491 fonts. The first two fills are reserved: changes to their predefined values are not respected. |
cellStyle (18.8.7, 2.1.697) | No limits; builtinId any 32-bit unsigned integer; iLevel an unsigned integer; ids 12 to 14 undefined. | name up to 255 characters and unique; xfId unique; builtinId 0 to 53; iLevel 0 to 7 and only used for the RowLevel and ColLevel styles (built-in 1 and 2). Built-in 12, 13 and 14 are Emphasis 1, 2 and 3. |
cellStyles, cellStyleXfs, cellXfs (18.8.8 to 18.8.10; 2.1.698 to 2.1.700) | The style xf and the cell xf must both be read to get a cell’s formatting. | At most 65430 records each, and cellXfs plus the non-built-in cellStyleXfs records together at most 65430. Only the cell xf defines the formatting a cell shows. |
dxfs (18.8.15, 2.1.701) | Unbounded. | At most 2147483647. |
family (18.8.18, 2.1.703) | An int; implies a character set. | 0 to 5, and read as the font family, not a character set. |
font (18.8.22, 2.1.706) | Children in a choice, any order. | Requires the order i, strike, condense, extend, outline, shadow, u, vertAlign, sz, color, name, family, charset, scheme. (b is not in that list.) |
name (18.8.29, 2.1.711) | 0 to 31 characters. | 1 to 31 characters before escaping. |
gradientFill, stop (18.8.24, 18.8.38; 2.1.708, 2.1.716) | degree and position are doubles. | degree between -1.7E308 and 1.7E308; position between 0 and 1. |
indexedColors, mruColors (18.8.27, 18.8.28; 2.1.709, 2.1.710) | Unbounded children. | At most 64 rgbColor and 10 color children. |
numFmt (18.8.30, 2.1.712) | Built-in 14 is mm-dd-yy, 22 m/d/yy h:mm, 37 to 40 use a space before the closing text (#,##0 ;(#,##0)), 47 mmss.0, Korean 55 yyyy-mm-dd. No limit on formatCode. | 14 is m/d/yyyy, 22 m/d/yyyy h:mm, 37 to 40 use _) (#,##0_);(#,##0), and so on), 47 mm:ss.0, Korean 55 yyyy/mm/dd. formatCode is under 255 characters and must match the grammar [MS-OI29500] gives. |
numFmts (18.8.31, 2.1.713) | No limit; three sections not described; & joins text; a percent format multiplies numbers between 0 and 1; no entry for /; e+, e-, E+ and E- are scientific; date codes e and ee become yy. | At most 206 custom formats (more are written but cannot be loaded). Three sections mean positive, negative, zero. & is shown as a literal. Percent applies to any number. / is a fraction character only between number symbols (0, #, ?). Only E+ and E- start scientific notation. e and ee become yyyy outside the Japanese and Traditional Chinese locales. |
protection (18.8.33, 2.1.714) | No defaults. | locked defaults to true, hidden to false. |
styleSheet (18.8.39, 2.1.717) | Every child optional. | Every child that the workbook refers to must be present, or the file is non-conformant. |
tableStyle, tableStyleElement, tableStyles (18.8.40 to 18.8.42; 2.1.718 to 2.1.720) | Built-in table styles are written as tableStyle; unbounded elements; size unsigned. | Only user-defined styles are written. name 1 to 255 characters; at most 28 tableStyleElement; size 1 to 9; defaultTableStyle and defaultPivotStyle 1 to 255 characters. |
xf (18.8.45, 2.1.721) | One meaning for the apply* attributes. | In cellStyleXfs (default true) the attribute says the style’s own part is applied. In cellXfs (default false) it says whether the cell overrides the style: when false, a later change to the named style also changes the cell’s part; when true, the cell keeps its own. If the cell’s part differs from the style’s, the attribute must be true. This holds for applyAlignment, applyBorder, applyFill, applyFont, applyNumberFormat and applyProtection. |
Example
A minimal styles part with one extra format, bold red text with a thin bottom border and two decimal places (hand-written):
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<fonts count="2">
<font><sz val="11"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font>
<font><b/><sz val="11"/><color rgb="FFFF0000"/><name val="Calibri"/></font>
</fonts>
<fills count="2">
<fill><patternFill patternType="none"/></fill>
<fill><patternFill patternType="gray125"/></fill>
</fills>
<borders count="2">
<border><left/><right/><top/><bottom/><diagonal/></border>
<border><left/><right/><top/><bottom style="thin"><color auto="1"/></bottom><diagonal/></border>
</borders>
<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>
<cellXfs count="2">
<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>
<xf numFmtId="2" fontId="1" fillId="0" borderId="1" xfId="0"
applyNumberFormat="1" applyFont="1" applyBorder="1"/>
</cellXfs>
<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>
</styleSheet>
A cell written <c r="B2" s="1"> uses the second
xf: built-in format 2 (0.00), font 1 and border 1.
Sources
- ECMA-376 1st edition, Part 4, SpreadsheetML reference – HTML rendering of section 3.8 and the simple types in 3.18, one page per element
- [MS-OI29500] – Microsoft’s notes on how Office implements ISO/IEC 29500, including section 18.8