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>
new TableCellBorders(
new TopBorder { Val = BorderValues.Double, Size = 4, Space = 0, Color = "000000" },
new BottomBorder { Val = BorderValues.Nil });
Notes
w:val="nil"suppresses the border entirely (wins over any table-style border).- Diagonal borders (
w:tl2brtop-left to bottom-right,w:tr2bltop-right to bottom-left) are only valid inw:tcBorders.