w:tc (Table Cell)

Contains the content and formatting properties for a single table cell.

Parent elements

Child elements

Description

w:tc is a table cell containing one or more block-level elements (paragraphs and/or nested tables). It is defined in ECMA-376 Part 1 §17.4.66.

Every w:tc must contain at least one w:p as its last child. Cell properties are specified in an optional leading w:tcPr element. Cells span multiple columns via w:gridSpan in w:tcPr, and merge vertically via w:vMerge.

Attributes

Attribute Type Possible Values Description
(none) Properties are expressed via the w:tcPr child element.

Examples

<w:tc>
  <w:tcPr>
    <w:tcW w:w="2500" w:type="dxa"/>
  </w:tcPr>
  <w:p>
    <w:r><w:t>Cell content</w:t></w:r>
  </w:p>
</w:tc>

Notes

  • The last element in a w:tc must always be a w:p (even if empty). Omitting it is a spec violation.
  • Cells in a vertically merged block that are not the top cell use <w:vMerge/> (no w:val) and still require a w:p child.