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
Represents a table in the Word document.
=20[DefaultMember("Item")] public sealed class Table : Element=20
<DefaultMember("Item")> _ =09Public NotInheritable Class Table =09=09Inherits Element=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.
=20The following sample demonstrates inserting a new table at the end of a = document as well as finding the first table in a document.
=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
'--- 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
Name | =20
Description | =20
---|---|
=20 | Returns an AbsolutePositioning object on which you can control the a= bsolute positioning for the table. | =20
=20 | Sets or returns a TableFormatting object representing the formatting of this t= able (borders, padding, shading, etc). | =20
=20 | Returns an int representing the num=
ber of rows in the first row of this table. | =20
=20 | The page Table.PreferredWidth could not be found= . | =20
=20 | Sets or returns a NamedStyle object that represents the Style of the current table.= | =20
Name | =20
Description | =20
---|---|
=20 | Returns a Tab= leCell object that represents the table cell that exists at the given c= olumn and row. | =20
Name | =20
Description | =20
---|---|
=20 | Adds a specified number of columns to the horizo= ntal end of the table. | =20
=20 | Adds a specified number of rows to the vertical = end of the table. | =20
=20 | Creates a bookmark on the specified row using th= e specified name. | =20
=20 | {excerpt-include:Table.DeleteColumns(Int32,= p> | =20
=20 | Deletes one or more rows from the table. | =20
=20 | Returns the number of columns in the specified r= ow of the table. | =20
=20 | 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). | =20
=20 | Returns a TableCell.WidthUnits object that represents the units used for = the width of a particular column. | =20
=20 | Returns a double that represents the preferr= ed width of this cell, with the associated units return in units. | =20
=20 | 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). | =20
=20 | Returns or a boolean that represent=
s if the row height is "exact" (true) or "at least" (fa=
lse). | =20
=20 | Imports data from an array of objects to the cur= rent table. | =20
=20 | Inserts one or more columns at the specified pos= ition in the table. | =20
=20 | Inserts one or more rows at the specified positi= on in the table. | =20
=20 | Merges the specified set of cells into a single = cell. | =20
=20 | 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. | =20
=20 | Sets a TableCell.WidthUnits object that represents the units used for the= width of a particular column. | =20
=20 | Sets the preferred width of the table and th= e units for said width. | =20
=20 | 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). | =20
=20 | Sets a boolean that represents if t=
he row height is "exact" (true) or "at least" (false).<=
/td>=20
|