Message-ID: <1720536233.8819.1711663063611.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8818_2123947981.1711663063611" ------=_Part_8818_2123947981.1711663063611 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Table

Table

Description

=20

Represents a table in the Word document.

=20
C#
=20
[DefaultMember("Item")]
 public sealed class Table : Element
=20
=20
vb.net
=20
<DefaultMember("Item")> _
=09Public NotInheritable Class Table
=09=09Inherits Element
=20
=20

Remarks

=20

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

=20

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

=20

Examples

=20
C#
=20

          //--- Insert a table at the end of a new document with 3 rows and=
 5 columns
          WordApplication app =3D new WordApplication();
          Document doc =3D app.Create();
          Table table =3D doc.InsertTableAfter(3, 5);

          //--- Get the first table of an existing document
          WordApplication app =3D new WordApplication();
          Document doc =3D app.Open(@"C:\sample.doc");
          Table table =3D doc.GetElements(Element.Type.Table)[0];
        
=20
=20
vb.net
=20

          '--- Insert a table at the end of a new document with 3 rows and =
5 columns
          Dim app As New WordApplication()
          Dim doc As Document =3D app.Create()
          Dim table As Table =3D doc.InsertTableAfter(3, 5)

          '--- Get the first table of an existing document
          Dim app As New WordApplication()
          Dim doc As Document =3D app.Open("C:\sample.doc")
          Dim table As Table =3D doc.GetElements(Element.Type.Table)(0)
        
=20
=20

Properties

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

AbsolutePositioning

Returns an AbsolutePositioning object on which you can control the a= bsolute positioning for the table.

For= matting

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

NumRow= s

Returns an int representing the num= ber of rows in the first row of this table.

PreferredW= idth

The page Table.PreferredWidth could not be found= .

Style

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

Indexers

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

Item(Int32, Int32)

Returns a Tab= leCell object that represents the table cell that exists at the given c= olumn and row.
=20

Methods

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

AddColumns(Int32)

Adds a specified number of columns to the horizo= ntal 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 th= e 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 r= ow of the table.

GetPreferredColumnWidth(Int32)

Returns an int representing the wid= th of a particular column. The GetPreferredColumnWidth method returns the width of the column i= n twips. One twip =3D (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 preferr= ed width of this cell, with the associated units return in units.

GetRowHeight(Int32)

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

GetRowHeightExact(Int32)

Returns or a boolean that represent= s if the row height is "exact" (true) or "at least" (fa= lse).

ImportDataRow(Object())

Imports data from an array of objects to the cur= rent table.

InsertColumns(Int32, Int32)

Inserts one or more columns at the specified pos= ition in the table.

InsertRows(Int32, Int32)

Inserts one or more rows at the specified positi= on 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 fir= st set the PreferredColu= mnWidthUnit of that column.

SetPreferredColumnWidthUnits(Int32, TableCell.WidthUnits)

=20
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 th= e 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 = =3D (1/20 pt) or (1/1440 in).

SetRowHeightExact(Int32, Boolean)

Sets a boolean that represents if t= he row height is "exact" (true) or "at least" (false).<= /td>=20
------=_Part_8818_2123947981.1711663063611--