TopMargin Class

Table Cell Top Margin Default.When the object is serialized out as xml, its qualified name is w:top.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.TableWidthType
        DocumentFormat.OpenXml.Wordprocessing.TopMargin

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

Syntax

'Declaration
Public Class TopMargin _
    Inherits TableWidthType
'Usage
Dim instance As TopMargin
public class TopMargin : TableWidthType

Remarks

[ISO/IEC 29500-1 1st Edition]

17.4.76 top (Table Cell Top Margin Default)

This element specifies the amount of space which shall be left between the top extent of the cell contents and the top border of all table cells within the parent table. This setting can be overridden by the table cell top margin definition specified by the top element contained within the table cell's properties (§17.4.78).

This value is specified in the units applied via its type attribute. Any width value of type pct or auto for this element shall be ignored.

If this element is omitted, then it shall inherit the table cell margin from the associated table style. If a top margin is never specified in the style hierarchy, then this table shall have no top cell padding by default (excepting individual cell overrides).

[Example: Consider a two by two table in which the default table cell top margin is specified to be exactly 0.25 inches, as follows (marked with an arrow in the first table cell below):

R1C1

R2C1

R2C1

R2C2

This table property is specified using the following WordprocessingML markup:

<w:tbl>
<w:tblPr>
<w:tblCellMar>
<w:top w:w="360" w:type="dxa"/>
</w:tblCellMar>
</w:tblPr>
…
</w:tbl>

Every cell in the table has a default cell margin setting it to 360 twentieths of a point. end example]

Parent Elements

tblCellMar (§17.4.42); tblCellMar (§17.4.43)

This element’s content model is defined by the common table measurement definition in §17.4.88.

[ISO/IEC 29500-1 1st Edition]

17.4.78 top (Table Cell Top Margin Exception)

This element specifies the amount of space which shall be left between the top extent of the cell contents and the top border of a specific table cell within a table. This setting shall override the table cell top margin definition specified by the top element contained within the table properties (§17.4.76).

This value is specified in the units applied via its type attribute. Any width value of type pct or auto for this element shall be ignored.

If omitted, then this table cell shall use the bottom cell margins defined in the top element contained within the table properties (§17.4.76).

[Example: Consider a table with two cells in which the first table cell’s top margin is specified via an exception to be ten times larger (0.2 inches vs. 0.02 inches) than the other table cell margins:

This text fills the extents of the cell.

So does this

The first cell in the table would be specified using the following WordprocessingML:

<w:tc>
<w:tcPr>
<w:tcMar>
<w:top w:w="288" w:type="dxa" />
</w:tcMar>
</w:tcPr>
</w:tc>

The first cell in this table has an exception applied to the table cell top cell margin setting it to 288 twentieths of a point (0.2 inches). end example]

Parent Elements

tcMar (§17.4.69)

This element’s content model is defined by the common table measurement definition in §17.4.88.

© 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

TopMargin Members

DocumentFormat.OpenXml.Wordprocessing Namespace