w:tblStyleColBandSize (Table Style Column Band Size)
Specifies the number of columns in each column banding group when a table style applies banded column formatting.
Parent elements
Description
w:tblStyleColBandSize sets the width of each alternating column band (in number of columns) used when a table style applies band1Vert/band2Vert conditional formatting. A value of 1 alternates every column; a value of 2 alternates every two columns.
It is defined in ECMA-376 Part 1 §17.4.57.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
xsd:integer |
Positive integer | Number of columns in each band. Default is 1. |
Examples
<!-- Band every 2 columns (columns 1-2 get band1, 3-4 get band2, etc.) -->
<w:tblPr>
<w:tblStyle w:val="TableGrid"/>
<w:tblStyleColBandSize 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="0"/>
</w:tblPr>
using DocumentFormat.OpenXml.Wordprocessing;
var tblPr = new TableProperties(
new TableStyle { Val = "TableGrid" },
new TableStyleColumnBandSize { Val = 2 }
);
Notes
- Column banding is rendered only when the table’s
w:tblLookhasw:noVBand="0"(i.e. vertical banding enabled). w:tblStyleColBandSizeworks in conjunction withw:tblStylePr w:type="band1Vert"andw:type="band2Vert"in the referenced table style.