TableRowHeight Class

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

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.TableRowHeight

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

Syntax

'Declaration
Public Class TableRowHeight _
    Inherits OpenXmlLeafElement
'Usage
Dim instance As TableRowHeight
public class TableRowHeight : OpenXmlLeafElement

Remarks

[ISO/IEC 29500-1 1st Edition]

17.4.81 trHeight (Table Row Height)

This element specifies the height of the current table row within the current table. This height shall be used to determine the resulting height of the table row, which can be absolute or relative (depending on its attribute values).

If omitted, then the table row shall automatically resize its height to the height required by its contents (the equivalent of an hRule value of auto).

[Example: Consider the following WordprocessingML table:

Some text in R1C1.

Examining the WordprocessingML for this table, the trHeight element is not specified, so the row heights are automatically determined by their contents (in the first row, the text Some text in R1C1.). If the first row shall be restricted to 0.1 inches high (144 twentieths of a point) regardless of its contents, that would be specified using the trHeight element as follows:

<w:trPr>
<w:trHeight w:val="144" w:hRule="exact"/>
</w:trPr>

The resulting table row would be exactly 144 twentieths of a point high:

Some text in R1C1.

end example]

Parent Elements

trPr (§17.4.82); trPr (§17.7.6.10); trPr (§17.7.6.11); trPr (§17.4.83)

Attributes

Description

hRule (Table Row Height Type)

Specifies the meaning of the height specified for this table row.

The meaning of the value of the val attribute is defined based on the value of the hRule attribute for this table row as follows:

  • If the value of hRule is auto, then the table row's height should be automatically determined based on the height of its contents. The h value is ignored.

  • If the value of hRule is atLeast, then the table row's height should be at least the value the h attribute.

  • If the value of hRule is exact, then the table row's height should be exactly the value of the h attribute.

If this attribute is omitted, then its value shall be assumed to be auto.

[Example: Consider the following paragraph containing a table row:

<w:tr>
  <w:trPr>
    <w:trHeight w:val="2189" w:hRule="atLeast"/>
  </w:trPr>
  …
</w:tr>

The hRule attribute specifies a value of atLeast, so the table row is a minimum of 2189 twentieths of a point high regardless of its contents, since its val value is 2189 twentieths of a point. end example]

The possible values for this attribute are defined by the ST_HeightRule simple type (§17.18.37).

val (Table Row Height)

Specifies the table row's height.

This height is expressed in twentieths of a point.

If this attribute is omitted, then its value shall be assumed to be 0.

The meaning of the value of the val attribute is defined based on the value of the hRule attribute for this table row as follows:

  • If the value of hRule is auto, then the table row's height should be automatically determined based on the height of its contents. This value is ignored.

  • If the value of hRule is atLeast, then the table row's height should be at least the value of this attribute.

  • If the value of hRule is exact, then the table row's height should be exactly the value of this attribute.

[Example: Consider the following table row:

<w:tr>
  <w:trPr>
    <w:trHeight w:val="2189" w:hRule="atLeast"/>
  </w:trPr>
  …
</w:tr>

The val attribute specifies a value of 2189 twentieths of a point, so this table row is a minimum of 2189 twentieths of a point high regardless of its contents (growing if needed), since its hRule value is set to atLeast. end example]

The possible values for this attribute are defined by the ST_TwipsMeasure simple type (§22.9.2.14).

[Note: The W3C XML Schema definition of this element’s content model (CT_Height) 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

TableRowHeight Members

DocumentFormat.OpenXml.Wordprocessing Namespace