[Table of Contents] [docx version]

SpreadsheetML Reference Material - Table of Contents

row (Row)

The element expresses information about an entire row of a worksheet, and contains all cell definitions for a particular row in the worksheet.

[Example:

This row expresses information about row 2 in the worksheet, and contains 3 cell definitions.

<row r="2" spans="2:12">
<c r="C2" s="1">
<f>PMT(B3/12,B4,-B5)</f>
<v>672.68336574300008</v>
</c>

<c r="D2">
<v>180</v>
</c>

<c r="E2">
<v>360</v>
</c>
</row>

end example]

Parent Elements

sheetData3.3.1.77)

 

Child Elements

Subclause

c (Cell)

§3.3.1.3

extLst (Future Feature Data Storage Area)

§3.2.10

 

Attributes

Description

collapsed (Collapsed)

'1' if the rows 1 level of outlining deeper than the current row are in the collapsed outline state. It means that the rows which are 1 outline level deeper (numerically higher value) than the current row are currently hidden due to a collapsed outline state.

 

It is possible for collapsed to be false and yet still have the rows in question hidden. This can be achieved by having a lower outline level collapsed, thus hiding all the child rows.

 

[Example:

This example shows 3 levels of outlining:

 

 

In the XML shall be:

<sheetData>
<row r="6" outlineLevel="3"/>
<row r="7" outlineLevel="3"/>
<row r="8" outlineLevel="2"/>
<row r="9" outlineLevel="1"/>
</sheetData>

 

end example]

 

[Example:

This example shows the same outline feature, with the middle level collapsed:

 

 

In the XML shall be:

<sheetData>
<row r="6" hidden="1" outlineLevel="3"/>
<row r="7" hidden="1" outlineLevel="3"/>
<row r="8" hidden="1" outlineLevel="2"/>
<row r="9" outlineLevel="1" collapsed="1"/>
</sheetData>

 

end example]

 

[Example:

This example shows the same outline feature as above, where both the middle and lowest level are collapsed:

 

 

In the XML shall be:

 

<sheetData>
<row r="6" hidden="1" outlineLevel="3"/>
<row r="7" hidden="1" outlineLevel="3"/>
<row r="8" hidden="1" outlineLevel="2"/>
<row r="9" hidden="1" outlineLevel="1" collapsed="1"/>
<row r="10" collapsed="1"/>
</sheetData>

 

Note that in this case, if the lowest level were expanded, the middle level would remain collapsed due to collapsed being true on row 9.

 

end example]

 

See description of outlinePr element's summaryBelow and summaryRight attributes for detailed information.

 

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

customFormat (Custom Format)

'1' if the row style should be applied.

 

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

customHeight (Custom Height)

'1' if the row height has been manually set.

 

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

hidden (Hidden)

'1' if the row is hidden, e.g., due to a collapsed outline or by manually selecting and hiding a row.

 

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

ht (Row Height)

Row height measured in point size. There is no margin padding on row height.

 

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

outlineLevel (Outline Level)

Outlining level of the row, when outlining is on. See description of outlinePr element's summaryBelow and summaryRight attributes for detailed information.

 

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

ph (Show Phonetic)

'1' if the row should show phonetic.

 

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

r (Row Index)

Row index. Indicates to which row in the sheet this <row> definition corresponds.

 

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

s (Style Index)

Index to style record for the row (only applied if customFormat attribute is '1')

 

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

spans (Spans)

Optimization only, and not required. Specifies the range of non-empty columns (in the format X:Y) for the block of rows to which the current row belongs. To achieve the optimization, span attribute values in a single block should be the same.

 

There are 16 rows per block, beginning with the first row.

 

Note: this is an optimization, and is purely optional. Different span values within the same row block is allowed. Not writing the span value at all is also allowed.

 

Blank rows are not required to write out span values.

 

For example, if cells F8, E9, and D10 have data in them and the rest of the sheet is empty, then for those three rows (8,9, and 10), the spans value should each be "4:6":

 

<sheetData>
<row r="8" spans="4:6">
<c r="F8">
<v>1</v>
</c>
</row>

<row r="9" spans="4:6">
<c r="E9">
<v>2</v>
</c>
</row>

<row r="10" spans="4:6">
<c r="D10">
<v>3</v>
</c>
</row>
</sheetData>

 

For example, if cells A1 and J10 have data in them and the rest of the sheet is empty, then the rows should be written like this:

 

<sheetData>
<row r="1" spans="1:10">
<c r="A1">
<v>1</v>
</c>
</row>

<row r="10" spans="1:10">
<c r="J10">
<v>2</v>
</c>
</row>
</sheetData>

 

The possible values for this attribute are defined by the ST_CellSpans simple type (§3.18.10).

thickBot (Thick Bottom)

'1' if any cell in the row has a medium or thick bottom border, or if any cell in the row directly below the current row has a thick top border. When true and customHeight is false, this flag means that the row height has been adjusted higher by .75 points of the normal style font height. This also means that if the row no longer contains these borders, then the height is automatically re-adjusted down.

 

This adjustment is in addition to any adjustment of height due to thickTop.

 

Medium borders are these enumeration values from the Styles Part:

mediumDashDotDot

slantDashDot

mediumDashDot

mediumDashed

medium

Thick borders are these enumeration values from the Styles Part:

thick

double

 

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

thickTop (Thick Top Border)

True if the row has a medium or thick top border, or if any cell in the row directly above the current row has a thick bottom border. When true and customHeight is false, this flag means that the row height has been adjusted higher by .75 points of the normal style font height. This also means that if the row no longer contains these borders, then the height is automatically re-adjusted down.

 

This adjustment is in addition to any adjustment of height due to thickBot.

 

Medium borders are these enumeration values from the Styles Part:

mediumDashDotDot

slantDashDot

mediumDashDot

mediumDashed

medium

 

Thick borders are these enumeration values from the Styles Part:

thick

double

 

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

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

<complexType name="CT_Row">

   <sequence>

   <element name="c" type="CT_Cell" minOccurs="0" maxOccurs="unbounded"/>

   <element name="extLst" minOccurs="0" type="CT_ExtensionList"/>

   </sequence>

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

   <attribute name="spans" type="ST_CellSpans" use="optional"/>

   <attribute name="s" type="xsd:unsignedInt" use="optional" default="0"/>

   <attribute name="customFormat" type="xsd:boolean" use="optional" default="false"/>

   <attribute name="ht" type="xsd:double" use="optional"/>

   <attribute name="hidden" type="xsd:boolean" use="optional" default="false"/>

   <attribute name="customHeight" type="xsd:boolean" use="optional" default="false"/>

   <attribute name="outlineLevel" type="xsd:unsignedByte" use="optional" default="0"/>

   <attribute name="collapsed" type="xsd:boolean" use="optional" default="false"/>

   <attribute name="thickTop" type="xsd:boolean" use="optional" default="false"/>

   <attribute name="thickBot" type="xsd:boolean" use="optional" default="false"/>

   <attribute name="ph" type="xsd:boolean" use="optional" default="false"/>

</complexType>