Skip to end of metadata
Go to start of metadata

Description

Represents a table in the Word document.

C#
vb.net

Remarks

To create a new table, use Element.InsertTableBefore() or InsertTableAfter(). To get an existing table, use Element.GetElements or Element.Children and check which elements are of type Element.Type.Table.

The following sample demonstrates inserting a new table at the end of a document as well as finding the first table in a document.

Examples

C#
vb.net

Properties

Name

Description

AbsolutePositioning

Returns an AbsolutePositioning object on which you can control the absolute positioning for the table.

Formatting

Sets or returns a TableFormatting object representing the formatting of this table (borders, padding, shading, etc).

NumRows

Returns an int representing the number of rows in the first row of this table.

PreferredWidth

The page Table.PreferredWidth could not be found.

Style

Sets or returns a NamedStyle object that represents the Style of the current table.

Indexers

Name

Description

Item(Int32, Int32)

Returns a TableCell object that represents the table cell that exists at the given column and row.

Methods

Name

Description

AddColumns(Int32)

Adds a specified number of columns to the horizontal end of the table.

AddRows(Int32)

Adds a specified number of rows to the vertical end of the table.

CreateBookmarkOnRow(Int32, String)

Creates a bookmark on the specified row using the specified name.

DeleteColumns(Int32, Int32)

{excerpt-include:Table.DeleteColumns(Int32,

DeleteRows(Int32, Int32)

Deletes one or more rows from the table.

GetNumColumns(Int32)

Returns the number of columns in the specified row of the table.

GetPreferredColumnWidth(Int32)

Returns an int representing the width of a particular column. The GetPreferredColumnWidth method returns the width of the column in twips. One twip = (1/20 pt) or (1/1440 in).

GetPreferredColumnWidthUnits(Int32)

Returns a TableCell.WidthUnits object that represents the units used for the width of a particular column.

GetPreferredWidth(out Units)

Returns a double that represents the preferred width of this cell, with the associated units return in units.

GetRowHeight(Int32)

Returns an int representing the height of a particular row in the table. The default row height unit is twips. One twip = (1/20 pt) or (1/1440 in).

GetRowHeightExact(Int32)

Returns or a boolean that represents if the row height is "exact" (true) or "at least" (false).

ImportDataRow(Object())

Imports data from an array of objects to the current table.

InsertColumns(Int32, Int32)

Inserts one or more columns at the specified position in the table.

InsertRows(Int32, Int32)

Inserts one or more rows at the specified position in the table.

MergeCells(Int32, Int32, Int32, Int32)

Merges the specified set of cells into a single cell.

SetPreferredColumnWidth(Int32, Int32)

Sets an int representing the width of a particular column. In order to set the width of a column, you must first set the PreferredColumnWidthUnit of that column.

SetPreferredColumnWidthUnits(Int32, TableCell.WidthUnits)

Sets a TableCell.WidthUnits object that represents the units used for the width of a particular column.

SetPreferredWidth(Double, Units)

Sets the preferred width of the table and the units for said width.

SetRowHeight(Int32, Int32)

Sets an int representing the height of a particular row in the table. A row height is set in twips. One twip = (1/20 pt) or (1/1440 in).

SetRowHeightExact(Int32, Boolean)

Sets a boolean that represents if the row height is "exact" (true) or "at least" (false).
  • No labels