w:tblStyleRowBandSize (Table Style Row Band Size)
Specifies the number of rows in each row banding group when a table style applies banded row formatting.
Parent elements
Description
w:tblStyleRowBandSize sets the height of each alternating row band (in number of rows) used when a table style applies band1Horz/band2Horz conditional formatting. A value of 1 (the default) alternates shading every row; a value of 2 alternates every two rows.
It is defined in ECMA-376 Part 1 §17.4.60.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
xsd:integer |
Positive integer | Number of rows in each band. Default is 1. |
Examples
<!-- Band every 2 rows -->
<w:tblPr>
<w:tblStyle w:val="TableGrid"/>
<w:tblStyleRowBandSize w:val="2"/>
<w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0"
w:firstColumn="1" w:lastColumn="0"
w:noHBand="0" w:noVBand="1"/>
</w:tblPr>
using DocumentFormat.OpenXml.Wordprocessing;
var tblPr = new TableProperties(
new TableStyle { Val = "TableGrid" },
new TableStyleRowBandSize { Val = 2 }
);
Notes
- Row banding is rendered only when
w:tblLookhasw:noHBand="0"(horizontal banding enabled). - Works with
w:tblStylePr w:type="band1Horz"andw:type="band2Horz"in the referenced table style. w:tblStyleRowBandSizeis separate fromw:tblStyleColBandSize— both can be set simultaneously.