w:tcBorders (Table Cell Borders)

Defines the border style for each edge (top, bottom, left, right, diagonal) of an individual table cell.

Parent elements

Description

w:tcBorders specifies the border settings for the individual sides and diagonals of a single table cell. It is defined in ECMA-376 Part 1 §17.4.67.

Cell-level borders in w:tcBorders override table-level defaults set in w:tblBorders. Each border edge (w:top, w:bottom, w:left, w:right) can have independent styling, and diagonal borders (w:tl2br, w:tr2bl) add visual emphasis. Using w:val="nil" completely suppresses an inherited border.

Attributes

Attribute Type Possible Values Description
(none) — — All borders are specified via child elements: w:top, w:left, w:bottom, w:right, w:insideH, w:insideV, w:tl2br, w:tr2bl.

Each border child element supports the same attributes as described in w:tblBorders.

Examples

<w:tcPr>
  <w:tcBorders>
    <w:top w:val="double" w:sz="4" w:space="0" w:color="000000"/>
    <w:bottom w:val="nil"/>
  </w:tcBorders>
</w:tcPr>

Notes

  • Precedence: Cell borders override table borders and table styles.
  • Diagonal Borders: w:tl2br and w:tr2bl are only valid in w:tcBorders, not in table-level w:tblBorders.
  • Size in Eighths: Border w:sz is in eighths-of-a-point; use sz=”8” for 1 point.
  • Space Attribute: w:space controls distance in points between border and cell content.
  • Nil Override: Use w:val="nil" to force removal of borders inherited from table or style.
  • Alternating Rows: Combine cell borders with w:shd for visually distinct row patterns.
  • Compatibility: All border styles render consistently in Office 2007+.