Partager via


TableBorders Class

Defines the TableBorders Class.When the object is serialized out as xml, its qualified name is w:tblBorders.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Wordprocessing.TableBorders

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(InsideHorizontalBorder))> _
<ChildElementInfoAttribute(GetType(EndBorder), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(InsideVerticalBorder))> _
<ChildElementInfoAttribute(GetType(TopBorder))> _
<ChildElementInfoAttribute(GetType(LeftBorder))> _
<ChildElementInfoAttribute(GetType(StartBorder), FileFormatVersions.Office2010)> _
<ChildElementInfoAttribute(GetType(BottomBorder))> _
<ChildElementInfoAttribute(GetType(RightBorder))> _
Public Class TableBorders _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As TableBorders
[ChildElementInfoAttribute(typeof(InsideHorizontalBorder))]
[ChildElementInfoAttribute(typeof(EndBorder), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(InsideVerticalBorder))]
[ChildElementInfoAttribute(typeof(TopBorder))]
[ChildElementInfoAttribute(typeof(LeftBorder))]
[ChildElementInfoAttribute(typeof(StartBorder), FileFormatVersions.Office2010)]
[ChildElementInfoAttribute(typeof(BottomBorder))]
[ChildElementInfoAttribute(typeof(RightBorder))]
public class TableBorders : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • TopBorder <w:top>

  • LeftBorder <w:left>

  • StartBorder <w:start>

  • BottomBorder <w:bottom>

  • RightBorder <w:right>

  • EndBorder <w:end>

  • InsideHorizontalBorder <w:insideH>

  • InsideVerticalBorder <w:insideV>

[ISO/IEC 29500-1 1st Edition]

17.4.39 tblBorders (Table Borders)

This element specifies the set of borders for the edges of the current table, using the six border types defined by its child elements.

If the cell spacing for any row is non-zero as specified using the tblCellSpacing element (§17.4.45; §17.4.44; §17.4.46), then there is no border conflict and the table border (or table-level exception border, if one is specified) shall be displayed.

If the cell spacing is zero, then there is a conflict [Example: Between the left border of all cells in the first column and the left border of the table. end example], which shall be resolved as follows:

  • If there is a cell border, then the cell border shall be displayed

  • If there is no cell border but there is a table-level exception border on this table row, then the table-level exception border shall be displayed

  • If there is no cell or table-level exception border, then the table border shall be displayed

If this element is omitted, then this table shall have the borders specified by the associated table style. If no borders are specified in the style hierarchy, then this table shall not have any table borders.

[Example: Consider a table with no associated table style, which defines a set of table borders via direct formatting as follows:

These table borders are specified using the following WordprocessingML:

<w:tbl>
<w:tblPr>
<w:tblW w:w="0" w:type="auto"/>
<w:tblBorders>
<w:top w:val="single" w:sz="4" w:space="0" w:color="000000" w:themeColor="text1"/>
<w:left w:val="single" w:sz="4" w:space="0" w:color="000000" w:themeColor="text1"/>
<w:bottom w:val="single" w:sz="4" w:space="0" w:color="000000" w:themeColor="text1"/>
<w:right w:val="single" w:sz="4" w:space="0" w:color="000000" w:themeColor="text1"/>
<w:insideH w:val="single" w:sz="4" w:space="0" w:color="000000" w:themeColor="text1"/>
<w:insideV w:val="single" w:sz="4" w:space="0" w:color="000000" w:themeColor="text1"/>
</w:tblBorders>
…
</w:tblPr>
…
</w:tbl>

The tblBorders element specifies the set of table borders applied to the current table. end example]

Parent Elements

tblPr (§17.4.60); tblPr (§17.4.59); tblPr (§17.7.6.4); tblPr (§17.7.6.3)

Child Elements

Subclause

bottom (Table Bottom Border)

§17.4.4

end (Table Trailing Edge Border)

§17.4.13

insideH (Table Inside Horizontal Edges Border)

§17.4.23

insideV (Table Inside Vertical Edges Border)

§17.4.25

start (Table Leading Edge Border)

§17.4.37

top (Table Top Border)

§17.4.77

[Note: The W3C XML Schema definition of this element’s content model (CT_TblBorders) is located in §A.1. end note]

[ISO/IEC 29500-1 1st Edition]

17.4.40 tblBorders (Table Borders Exceptions)

This element specifies the set of borders for the edges of the parent table row via a set of table-level property exceptions, using the six border types defined by its child elements.

If the cell spacing for any row is non-zero as specified using the tblCellSpacing element (§17.4.45; §17.4.44; §17.4.46), then there is no border conflict and the table-level exception border shall be displayed.

If the cell spacing is zero, then there is a conflict [Example: Between the left border of all cells in the first column and the left border of the table-level exceptions. end example], which shall be resolved as follows:

  • If there is a cell border, then the cell border shall be displayed

  • If there is no cell border, then the table-level exception border shall be displayed

If this element is omitted, then this table shall have the borders specified by the associated table level borders (§17.4.39).

[Example: Consider a table in which the final two rows have a set of table-level property exceptions giving them a thicker set of table borders, as follows:

These table borders are specified via a set of table-level property exceptions using the following WordprocessingML:

<w:tr>
<w:tblPrEx>
<w:tblBorders>
<w:top w:val="single" w:sz="24" w:space="0" w:color="000000" w:themeColor="text1"/>
<w:left w:val="single" w:sz="24" w:space="0" w:color="000000" w:themeColor="text1"/>
<w:bottom w:val="single" w:sz="24" w:space="0" w:color="000000" w:themeColor="text1"/>
<w:right w:val="single" w:sz="24" w:space="0" w:color="000000" w:themeColor="text1"/>
<w:insideH w:val="single" w:sz="24" w:space="0" w:color="000000" w:themeColor="text1"/>
<w:insideV w:val="single" w:sz="24" w:space="0" w:color="000000" w:themeColor="text1"/>
</w:tblBorders>
</w:tblPrEx>
</w:tr>

The tblBorders element specifies the set of table borders applied to the final two rows in this table as part of the table-level property exceptions. end example]

Parent Elements

tblPrEx (§17.4.61); tblPrEx (§17.4.62)

Child Elements

Subclause

bottom (Table Bottom Border)

§17.4.4

end (Table Trailing Edge Border)

§17.4.13

insideH (Table Inside Horizontal Edges Border)

§17.4.23

insideV (Table Inside Vertical Edges Border)

§17.4.25

start (Table Leading Edge Border)

§17.4.37

top (Table Top Border)

§17.4.77

[Note: The W3C XML Schema definition of this element’s content model (CT_TblBorders) is located in §A.1. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

TableBorders Members

DocumentFormat.OpenXml.Wordprocessing Namespace