w:tblPr is the table properties container, grouping all table-level formatting properties. It is defined in ECMA-376 Part 1 §17.4.60.
w:tblPr is always the first child of w:tbl. It contains child elements such as w:tblStyle (style reference), w:tblW (width), w:tblBorders (table borders), w:tblCellMar (default cell margins), w:tblLook (conditional format application flags), and many others. Properties set at the table level apply to all cells unless overridden by cell-level properties (w:tcPr).
Table properties control the overall appearance and behavior of the table, including alignment, indentation, spacing, borders, shading, and column properties.
Attributes
Attribute
Type
Possible Values
Description
(none)
—
—
All table properties are expressed exclusively via child elements.
Common Child Elements
Child
Purpose
Example
w:tblStyle
Applies a named table style
<w:tblStyle w:val="TableGrid"/>
w:tblW
Table width (auto, fixed, percentage)
<w:tblW w:w="9638" w:type="dxa"/> (6.7 inches)
w:tblJc
Table alignment (left/center/right)
<w:tblJc w:val="center"/>
w:tblInd
Left indent from margin
<w:tblInd w:w="720" w:type="dxa"/> (0.5 inches)
w:tblBorders
Outer borders for table
<w:tblBorders><w:top .../></w:tblBorders>
w:tblCellMar
Default cell margins (top/left/right/bottom)
<w:tblCellMar><w:top .../></w:tblCellMar>
w:tblLook
Conditional formatting (first row, last row, banded)
var tblPr = new TableProperties(
new TableStyle { Val = "TableGrid" },
new TableWidth { Width = "5000", Type = TableWidthUnitValues.Pct }, // 100% width
new TableLook { Val = "0411" }); // First/last row + banded rows
var tblPr = new TableProperties(
new TableStyle { Val = "TableNormal" },
new TableWidth { Width = "9638", Type = TableWidthUnitValues.Dxa }, // 6.7 inches
new TableJustification { Val = TableRowAlignmentValues.Center },
new TableIndentation { Width = 0, Type = TableWidthUnitValues.Dxa },
new TableBorders(
new TopBorder { Val = BorderValues.Single, Sz = 12, Space = 0, Color = "000000" },
new LeftBorder { Val = BorderValues.Single, Sz = 12, Space = 0, Color = "000000" },
new BottomBorder { Val = BorderValues.Single, Sz = 12, Space = 0, Color = "000000" },
new RightBorder { Val = BorderValues.Single, Sz = 12, Space = 0, Color = "000000" },
new InsideHorizontalBorder { Val = BorderValues.Single, Sz = 12, Space = 0, Color = "000000" },
new InsideVerticalBorder { Val = BorderValues.Single, Sz = 12, Space = 0, Color = "000000" }),
new TableCellMarginDefault(
new TopMargin { Width = "80", Type = TableWidthUnitValues.Dxa },
new LeftMargin { Width = "80", Type = TableWidthUnitValues.Dxa },
new BottomMargin { Width = "80", Type = TableWidthUnitValues.Dxa },
new RightMargin { Width = "80", Type = TableWidthUnitValues.Dxa }));
var tblPr = new TableProperties(
new TableStyle { Val = "TableGrid" },
new TableWidth { Width = "8000", Type = TableWidthUnitValues.Dxa },
new TableIndentation { Width = 720, Type = TableWidthUnitValues.Dxa }, // 0.5 in indent
new TableCellSpacing { Width = "60", Type = TableWidthUnitValues.Dxa }, // 0.04 in spacing
new TableLook { Val = "0411" });
Width types: Percentage is relative to page width; twips (dxa) are absolute; auto-width adapts to content and container.
Measurement units: Twips = 1/20th point; 1 inch = 1440 twips, 1 cm ≈ 567 twips.
Default cell margins: Set via w:tblCellMar at table level; individual cells can override via w:tcMar for asymmetric padding.
Performance: Tables with many borders, complex properties, or excessive merging can impact rendering performance.
Accessibility: Use w:tblDescription and w:tblTitle for semantic table markup; helps screen readers understand table purpose.
Nested Tables: Nested tables inherit nothing from parent table; use w:tblPrEx for exception properties.
Spacing vs. Margins: w:tblCellSpacing is the gap between cells (like HTML cellspacing); w:tblCellMar is padding inside cells.
Privacy Notice
This site stores your theme preference and this acknowledgement in localStorage — no cookies, no tracking. When you use the contact form, your message is sent via Formspree (USA) to reach us.