w:tbl (Table)

Container for a table consisting of table properties, a table grid definition, and one or more table rows.

Child elements

Description

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 w:tblPr and w:tblGrid.

Examples

<w:tbl>
  <w:tblPr>
    <w:tblW w:w="5000" w:type="pct"/>
  </w:tblPr>
  <w:tblGrid>
    <w:gridCol w:w="2500"/>
    <w:gridCol w:w="2500"/>
  </w:tblGrid>
  <w:tr>
    <w:tc><w:p><w:r><w:t>Cell A</w:t></w:r></w:p></w:tc>
    <w:tc><w:p><w:r><w:t>Cell B</w:t></w:r></w:p></w:tc>
  </w:tr>
</w:tbl>

Notes

  • Every table cell (w:tc) must contain at least one paragraph (w:p) as its last child.
  • Tables must be immediate children of w:body, w:tc, w:hdr, or w:ftr; they cannot appear inside w:p.