Skip to main content

Wordprocessing Tables

Table Property Exceptions

Some row properties are specified as exceptions to the table-level properties using the <tblPrEx> element. The <tblPrEx> element contains all table-level properties which are being overridden for the row. This is typically used in legacy documents or where two existing independent tables are merged, in order to prevent the appearance of the second table from being superseded by the first table.

<w:tr>

<w:tblPrEx>

<w:tblBorders>

<w:top w:val="single" w:sz="12" w:space="0" w:color="FF0000" />

<w:start w:val="single" w:sz="24" w:space="0" w:color="00FF00" />

<w:bottom w:val="single" w:sz="12" w:space="0" w:color="0000FF" />

<w:end w:val="single" w:sz="24" w:space="0" w:color="000000" />

<w:insideH w:val="single" w:sz="24" w:space="0" w:color="FFFF00" />

<w:insideV w:val="single" w:sz="24" w:space="0" w:color="FF00FF" />

</w:tblBorders>

</w:tblPrEx>

</w:tr>

Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference §§ 17.4.61 and 17.4.82.

Word 2007 Example:

Table Row Borders

Note that the yellow (FFFF00) <insideH> element causes the top and bottom borders of the row to be yellow rather than the red (FF0000) and blue (0000FF) of the top and bottom.

Elements:​

The most commonly used table exceptions are below:

ElementDescription
jcSpecifies the alignment of the row when a table does not have the same width as the document margins: <w:jc w:val="right">. See <jc> within table row property for details.
shdSpecifies the shading for the row up to the table borders, and unlike cell shading, it includes any cell padding: <w:shd w:val="clear" w:color="auto" w:fill="EEECE1"/>. The shading consists of three components: the background color, an optional pattern, and an optional pattern color. The attributes include (theme-related attributes omitted): * color -- The foreground pattern color. Values are given as hex values (i.e., in RRGGBB format). No #, unlike hex values in HTML/CSS. E.g., fill="FFFF00". auto can be specified and is the default. Note that if the val specifies no shading format or is omitted, of if a theme is specified, this value is superseded. * fill -- The background color. Values are given as hex values (i.e., in RRGGBB format). No #, unlike hex values in HTML/CSS. E.g., fill="FFFF00". auto can be specified and is the default. * val -- Specifies the pattern to be used to lay the pattern color over the background color. For example, w:val="pct10" indicates that the shading style is a 10 percent foreground fill mask. Possible values are: clear (no pattern), pct10, pct12, pct15 . . ., diagCross, diagStripe, horzCross, horzStripe, nil, thinDiagCross, solid, etc. See ECMA-376, 3rd, § 17.18.78 for a complete listing. Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.4.31.
tblBordersSpecifies the borders for the row. Note that if the cell spacing is non-zero, there is no border conflict and the row exception border is applied. If the cell spacing is zero, then there is a conflict. Otherwise the cell border is applied. See Table Borders for details of this element. Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.4.4.
tblCellMarSpecifies the cell margins for cells in the row. See Table Cell Margins for details of this element.
tblCellSpacingSpecifies cell spacing for all cells in the row. It specifies the minimum amount of space after including the width of the table borders. This is superseded by the row cell spacing tblCellSpacing value. See Table Row Properties for details. Note that table-level cell spacing is added outside of the text margins. Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.4.45.
tblIndSpecifies the indentation to be added before the leading edge of the row (left edge in left-to-right tables): <w:tblInd w:w="2160" w:type="dxa"/>. The attributes are:
tblLayoutReference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.4.54.
tblLookReference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.4.55.
tblWReference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.4.65.