w:cnfStyle (Conditional Table Formatting Reference)
Specifies which conditional formatting components of a table or list style apply to the current element.
Description
w:cnfStyle (conditional formatting style) is a 12-bit mask that indicates which conditional formatting components from a table style or list style are active for the current element. The bits correspond to specific parts of the style (first row, last column, odd/even bands, etc.).
It is defined in ECMA-376 Part 1 §17.3.1.8 (paragraph context) and related sections for other parent elements.
Consumers use w:cnfStyle to apply the correct conditional formatting from the referenced style without recomputing the mask. The element is normally generated automatically by producers (editors) when a style is applied — it is rarely authored manually.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_Cnf |
12-character binary string (e.g. "100000000000") |
Bit mask indicating active conditional formatting components. |
Bit positions (left to right, 0-indexed)
| Bit | Meaning |
|---|---|
| 0 | First row |
| 1 | Last row |
| 2 | First column |
| 3 | Last column |
| 4 | Odd/banded column |
| 5 | Even/banded column |
| 6 | Odd/banded row |
| 7 | Even/banded row |
| 8 | NE corner cell |
| 9 | NW corner cell |
| 10 | SE corner cell |
| 11 | SW corner cell |
Examples
<!-- Paragraph properties indicating it is in the first row of a styled table -->
<w:pPr>
<w:cnfStyle w:val="100000000000"/>
</w:pPr>
using DocumentFormat.OpenXml.Wordprocessing;
var pPr = new ParagraphProperties(
new ConditionalFormatStyle { Val = "100000000000" }
);
Notes
- The
w:cnfStyleelement is informational for consumers. The actual style definitions live in the table style’sw:tblStylePrchild elements. - Do not confuse with
w:style(applied named style) orw:pStyle(paragraph style).