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 of a single table cell. It is defined in ECMA-376 Part 1 §17.4.67.

Cell-level borders in w:tcBorders override the table-level defaults set in w:tblBorders. Use w:val="nil" to completely suppress a border inherited from the table style.

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

  • w:val="nil" suppresses the border entirely (wins over any table-style border).
  • Diagonal borders (w:tl2br top-left to bottom-right, w:tr2bl top-right to bottom-left) are only valid in w:tcBorders.