GridColumn Class

Grid Column Definition.When the object is serialized out as xml, its qualified name is w:gridCol.

Inheritance Hierarchy

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

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

Syntax

声明
Public Class GridColumn _
    Inherits OpenXmlLeafElement
用法
Dim instance As GridColumn
public class GridColumn : OpenXmlLeafElement

Remarks

[ISO/IEC 29500-1 第 1 个版本]

17.4.16 gridCol (Grid Column Definition)

This element specifies the presence and details about a single grid column within a table grid. A grid column is a logical column in a table used to specify the presence of a shared vertical edge in the table. When table cells are then added to this table, these shared edges (or grid columns, looking at the column between those shared edges) determine how table cells are placed into the table grid.

[Example: If a table row specifies that it is preceded by two grid columns, then it would start on the third vertical edge in the table including edges which are not shared by all columns. end example]

If the table grid does not match the requirements of one or more rows in the table (i.e. it does not define enough grid columns), then the grid can be redefined as needed when the table is processed.

[Example: Consider the following, more complex table that has two rows and two columns; as shown, the columns are not aligned:

This table is represented by laying out the cells on a table grid consisting of three table grid columns as follows, each grid column representing a logical vertical column in the table:

The dashed lines represent the virtual vertical continuations of each table grid column, and thus resulting table grid is represented as the following in WordprocessingML:

<w:tblGrid>
  <w:gridCol w:w="5051" />
  <w:gridCol w:w="3008" />
  <w:gridCol w:w="1531" />
</w:tblGrid>

end example]

Parent Elements

tblGrid (§17.4.49); tblGrid (§17.4.48)

Attributes

Description

w (Grid Column Width)

Specifies the width of this grid column.

[Note: This value does not solely determine the actual width of the resulting grid column in the document. When the table is displayed in a document, these widths determine the initial width of each grid column, which can then be overridden by:

  • The table layout algorithm (§17.4.53;§17.4.54) applied to the current table row(s)

  • The preferred widths of specific cells which are part of that grid column as the table is displayed (which is an input to the algorithm above)

end note]

This value is specified in twentieths of a point.

If this attribute is omitted, then the last saved width of the grid column is assumed to be zero.

[Example: Consider the following table grid definition:

<w:tblGrid>
  <w:gridCol w:w="6888"/>
  <w:gridCol w:w="248"/>
  <w:gridCol w:w="886"/>
  <w:gridCol w:w="1554"/>
</w:tblGrid>

This table grid specifies four grid columns, each of which has an initial size of 6888 twentieths of a point, 248 twentieths of a point, 886 twentieths of a point, and 1554 twentieths of a point respectively. 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_TblGridCol) is located in §A.1. end note]

© ISO/IEC29500: 2008. 以上摘要已经由 Microsoft(和/或其代理公司)从英语翻译为简体中文,ISO 对此翻译不承担任何责任。

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

GridColumn Members

DocumentFormat.OpenXml.Wordprocessing Namespace