Description
The TableFormatting class is used to specify formatting that should be applied to a table. It also represents the table formatting of some named styles in the document.
Remarks
There are two ways to obtain an instance of this class: Create a new normal table formatting object using Document.CreateTableFormatting(). This will return a copy of a particular style's table formatting. The TableFormatting
object that is returned can then be used in conjunction with methods in the Element class to create tables with specific formatting.
The following example demonstrates both ways of getting table formatting, first by retrieving the NormalTable style's paragraph formatting from the document, second by retrieving a copy of the TableSimple1 style's paragraph formatting.
Examples
Properties
Name |
Description |
---|---|
Returns a boolean that represents whether or not this table's width will be set automatically by Word. |
|
Sets or returns a boolean that represents whether or not Word will attempt to keep a table created with this formatting on one page. |
|
Returns an Shading object which on which you can manipulate the default shading (fill color and/or pattern) properties of a table's cells that has this formatting. | |
Returns or sets an int that represents the default spacing between a table's cells that has this formatting. This is the distance in twips between the edge of a cell and the center of its border with an adjacent cell. One twip = (1/20 pt) or (1/1440 in) |
|
Sets or returns a ParagraphFormatting.Justification object that represents the justification for a table created with this formatting. Possible values: Left, Center, Right, LeftRight. | |
Sets or returns an int that represents the left indent for a table created with this formatting in twips. One twip = (1/20 pt) or (1/1440 in). |
|
Sets or returns a boolean that represents if Word will repeat the first row of a table created with this formatting as a header across multiple pages. |
Methods
Name |
Description |
---|---|
Returns a Border object that represents the default border for table cells at a specified location for a table created with this formatting. Individual table cells can override these border settings. Allowed locations are: Top, Left, Bottom, Right, Vertical, and Horizontal. Top, Left, Bottom, and Right refer to the default border for those sides of a table cell. Vertical and Horizontal refer to the border between table cells. | |
Returns an int that represents the default table cell margin at a particular location. One twip = (1/20 pt) or (1/1440 in) |
|
Sets an int that represents the default table cell margin at a particular location. One twip = (1/20 pt) or (1/1440 in) |