w:tbl is the root element for a table in a WordprocessingML document body. It is defined in ECMA-376 Part 1 §17.4.38.
A table contains an optional set of table-level properties (w:tblPr), a table grid definition (w:tblGrid), and one or more rows (w:tr). Tables can be nested inside table cells to arbitrary depth.
Attributes
Attribute
Type
Possible Values
Description
(none)
—
—
All table properties are expressed via child elements.
new Table(
new TableProperties(new TableWidth { Width = "5000", Type = TableWidthUnitValues.Pct }),
new TableGrid(
new GridColumn { Width = "2500" },
new GridColumn { Width = "2500" }),
new TableRow(
new TableCell(new Paragraph(new Run(new Text("Cell A")))),
new TableCell(new Paragraph(new Run(new Text("Cell B"))))),
new TableRow(
new TableCell(new Paragraph(new Run(new Text("Cell C")))),
new TableCell(new Paragraph(new Run(new Text("Cell D"))))));
new Table(
new TableProperties(new TableWidth { Width = "5000", Type = TableWidthUnitValues.Pct }),
new TableGrid(new GridColumn { Width = "2500" }, new GridColumn { Width = "2500" }),
new TableRow(
new TableCell(
new Paragraph(new Run(new Text("Cell with nested table:"))),
new Table(
new TableGrid(new GridColumn { Width = "2500" }, new GridColumn { Width = "2500" }),
new TableRow(
new TableCell(new Paragraph(new Run(new Text("Nested 1")))),
new TableCell(new Paragraph(new Run(new Text("Nested 2"))))))),
new TableCell(new Paragraph(new Run(new Text("Regular cell"))))));
Child element order: ECMA-376 specifies strict ordering: w:tblPr (optional), w:tblGrid (required), then w:tr elements (one or more).
Grid definition purpose: The w:tblGrid defines the logical grid columns; actual cell width is determined by w:tcPr/w:tcW in each cell.
Minimum table size: A table must contain at least one row (w:tr), and each row must contain at least one cell (w:tc).
Cell paragraph requirement: Every w:tc must end with at least one w:p (paragraph); cells cannot be empty or contain only tables.
Nested tables: Tables can be nested arbitrarily deep inside cells; nesting inside w:tc is valid, but w:tbl cannot be a direct child of w:p or w:body.
Row spanning and merging: Column spanning is controlled by w:gridSpan in w:tcPr; vertical merging is controlled by w:vMerge in w:tcPr.
Table-level properties override: Properties in w:tblPr apply to the entire table; cell-level properties (w:tcPr) take precedence for specific cells.
Performance: Very large tables (>100 rows) can impact rendering and file size; consider breaking into multiple tables if needed.
Width types: Table width can be percentage (pct), absolute twips (dxa), or auto; width is advisory and may be adjusted based on content.
Table placement: Tables are block-level elements and can only appear as direct children of w:body, w:tc, w:hdr, w:ftr, or other block containers; not inside w:p.
Accessibility: Include table title/description (in w:tblPr) and proper header row marking (w:tblHeader) for semantic markup.
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.