com.aspose.words.CompositeNodecom.aspose.words.Table
public class Table
Table is a block-level node and can be a child of classes derived from Story or
InlineStory. Table can contain one or more Row nodes. A minimal valid table needs to have at least one Row.
Property Getters/Setters Summary | ||
---|---|---|
int | getAlignment() | |
void | setAlignment(int value) | |
Specifies how an inline table is aligned in the document. The value of the property is TableAlignment integer constant. | ||
boolean | getAllowAutoFit() | |
void | setAllowAutoFit(boolean value) | |
Allows Microsoft Word and Aspose.Words to automatically resize cells in a table to fit their contents. | ||
boolean | getBidi() | |
void | setBidi(boolean value) | |
Gets or sets whether this is a right-to-left table. | ||
double | getBottomPadding() | |
void | setBottomPadding(double value) | |
Gets or sets the amount of space (in points) to add below the contents of cells. | ||
double | getCellSpacing() | |
void | setCellSpacing(double value) | |
Gets or sets the amount of space (in points) between the cells. | ||
Aspose.Words.NodeCollection | getChildNodes() | → inherited from Aspose.Words.CompositeNode |
Gets all immediate child nodes of this node. | ||
int | getCount() | → inherited from Aspose.Words.CompositeNode |
Gets the number of immediate children of this node. | ||
double | getDistanceBottom() | |
double | getDistanceLeft() | |
double | getDistanceRight() | |
double | getDistanceTop() | |
Aspose.Words.DocumentBase | getDocument() | → inherited from Aspose.Words.Node |
Gets the document to which this node belongs. | ||
Aspose.Words.Node | getFirstChild() | → inherited from Aspose.Words.CompositeNode |
Gets the first child of the node. | ||
Row | getFirstRow() | |
Returns the first Row node in the table. | ||
boolean | hasChildNodes() | → inherited from Aspose.Words.CompositeNode |
Returns true if this node has any child nodes. | ||
boolean | isComposite() | → inherited from Aspose.Words.CompositeNode |
Returns true as this node can have child nodes. | ||
Aspose.Words.Node | getLastChild() | → inherited from Aspose.Words.CompositeNode |
Gets the last child of the node. | ||
Row | getLastRow() | |
Returns the last Row node in the table. | ||
double | getLeftIndent() | |
void | setLeftIndent(double value) | |
Gets or sets the value that represents the left indent of the table. | ||
double | getLeftPadding() | |
void | setLeftPadding(double value) | |
Gets or sets the amount of space (in points) to add to the left of the contents of cells. | ||
Aspose.Words.Node | getNextSibling() | → inherited from Aspose.Words.Node |
Gets the node immediately following this node. | ||
Aspose.Words.NodeType | getNodeType() | |
Returns NodeType.Table. | ||
Aspose.Words.CompositeNode | getParentNode() | → inherited from Aspose.Words.Node |
Gets the immediate parent of this node. | ||
PreferredWidth | getPreferredWidth() | |
void | setPreferredWidth(PreferredWidth value) | |
Gets or sets the table preferred width. | ||
Aspose.Words.Node | getPreviousSibling() | → inherited from Aspose.Words.Node |
Gets the node immediately preceding this node. | ||
Aspose.Words.Range | getRange() | → inherited from Aspose.Words.Node |
Returns a Range object that represents the portion of a document that is contained in this node. | ||
double | getRightPadding() | |
void | setRightPadding(double value) | |
Gets or sets the amount of space (in points) to add to the right of the contents of cells. | ||
RowCollection | getRows() | |
Provides typed access to the rows of the table. | ||
Aspose.Words.Style | getStyle() | |
Gets or sets the table style applied to this table. | ||
Aspose.Words.StyleIdentifier | getStyleIdentifier() | |
Gets or sets the locale independent style identifier of the table style applied to this table. | ||
java.lang.String | getStyleName() | |
void | setStyleName(java.lang.String value) | |
Gets or sets the name of the table style applied to this table. | ||
int | getStyleOptions() | |
void | setStyleOptions(int value) | |
Gets or sets bit flags that specify how a table style is applied to this table. The value of the property is TableStyleOptions integer constant. | ||
int | getTextWrapping() | |
void | setTextWrapping(int value) | |
Get or sets TextWrapping |
||
double | getTopPadding() | |
void | setTopPadding(double value) | |
Gets or sets the amount of space (in points) to add above the contents of cells. |
Method Summary | ||
---|---|---|
void | autoFit(int behavior) | |
Resizes the table and cells according to the specified auto fit behavior. | ||
void | clearBorders() | |
Removes all table and cell borders on this table. | ||
void | clearShading() | |
Removes all shading on the table. | ||
Aspose.Words.Node | deepClone(boolean isCloneChildren) | → inherited from Aspose.Words.Node |
Creates a duplicate of the node. | ||
void | ensureMinimum() | |
If the table has no rows, creates and appends one Row. | ||
Aspose.Words.CompositeNode | getAncestor(java.lang.Class ancestorType) | → inherited from Aspose.Words.Node |
Gets the first ancestor of the specified object type. | ||
Aspose.Words.CompositeNode | getContainer() | → inherited from Aspose.Words.CompositeNode |
Reserved for internal use. | ||
Aspose.Words.Node | getNextMatchingNode(aspose.obfuscated.type curNode) | → inherited from Aspose.Words.CompositeNode |
Reserved for internal use. | ||
java.lang.String | getText() | → inherited from Aspose.Words.CompositeNode |
Gets the text of this node and of all its children. | ||
java.util.Iterator | iterator() | → inherited from Aspose.Words.CompositeNode |
Provides support for the for each style iteration over the child nodes of this node. | ||
void | remove() | → inherited from Aspose.Words.Node |
Removes itself from the parent. | ||
void | removeAllChildren() | → inherited from Aspose.Words.CompositeNode |
Removes all the child nodes of the current node. | ||
void | removeSmartTags() | → inherited from Aspose.Words.CompositeNode |
Removes all |
||
Aspose.Words.NodeList | selectNodes(java.lang.String xpath) | → inherited from Aspose.Words.CompositeNode |
Selects a list of nodes matching the XPath expression. | ||
Aspose.Words.Node | selectSingleNode(java.lang.String xpath) | → inherited from Aspose.Words.CompositeNode |
Selects the first Node that matches the XPath expression. | ||
java.lang.String | toString(SaveOptions saveOptions) | → inherited from Aspose.Words.Node |
Exports the content of the node into a string using the specified save options. | ||
java.lang.String | toTxt() | → inherited from Aspose.Words.Node |
Exports the content of the node into a string in plain text format. |
Property Getters/Setters Detail |
---|
getAlignment/setAlignment | |
public int getAlignment() / public void setAlignment(int value) |
The default value is
getAllowAutoFit/setAllowAutoFit | |
public boolean getAllowAutoFit() / public void setAllowAutoFit(boolean value) |
The default value is true
.
getBidi/setBidi | |
public boolean getBidi() / public void setBidi(boolean value) |
When true
, the cells in this row are laid out right to left.
The default value is false
.
getBottomPadding/setBottomPadding | |
public double getBottomPadding() / public void setBottomPadding(double value) |
getCellSpacing/setCellSpacing | |
public double getCellSpacing() / public void setCellSpacing(double value) |
getChildNodes | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.NodeCollection getChildNodes() |
Note, GetChildNodes(NodeType.Any, false)
and creates and returns a new collection every time it is accessed.
If there are no child nodes, this property returns an empty collection.
getCount | → inherited from Aspose.Words.CompositeNode |
public int getCount() |
getDistanceBottom | |
public double getDistanceBottom() |
getDistanceLeft | |
public double getDistanceLeft() |
getDistanceRight | |
public double getDistanceRight() |
getDistanceTop | |
public double getDistanceTop() |
getDocument | → inherited from Aspose.Words.Node |
public Aspose.Words.DocumentBase getDocument() |
The node always belongs to a document even if it has just been created and not yet added to the tree, or if it has been removed from the tree.
getFirstChild | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.Node getFirstChild() |
getFirstRow | |
public Row getFirstRow() |
hasChildNodes | → inherited from Aspose.Words.CompositeNode |
public boolean hasChildNodes() |
isComposite | → inherited from Aspose.Words.CompositeNode |
public boolean isComposite() |
getLastChild | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.Node getLastChild() |
getLastRow | |
public Row getLastRow() |
getLeftIndent/setLeftIndent | |
public double getLeftIndent() / public void setLeftIndent(double value) |
getLeftPadding/setLeftPadding | |
public double getLeftPadding() / public void setLeftPadding(double value) |
getNextSibling | → inherited from Aspose.Words.Node |
public Aspose.Words.Node getNextSibling() |
getNodeType | |
public Aspose.Words.NodeType getNodeType() |
getParentNode | → inherited from Aspose.Words.Node |
public Aspose.Words.CompositeNode getParentNode() |
If a node has just been created and not yet added to the tree, or if it has been removed from the tree, the parent is null.
getPreferredWidth/setPreferredWidth | |
public PreferredWidth getPreferredWidth() / public void setPreferredWidth(PreferredWidth value) |
The default value is
getPreviousSibling | → inherited from Aspose.Words.Node |
public Aspose.Words.Node getPreviousSibling() |
getRange | → inherited from Aspose.Words.Node |
public Aspose.Words.Range getRange() |
getRightPadding/setRightPadding | |
public double getRightPadding() / public void setRightPadding(double value) |
getRows | |
public RowCollection getRows() |
getStyle | |
public Aspose.Words.Style getStyle() |
getStyleIdentifier | |
public Aspose.Words.StyleIdentifier getStyleIdentifier() |
getStyleName/setStyleName | |
public java.lang.String getStyleName() / public void setStyleName(java.lang.String value) |
getStyleOptions/setStyleOptions | |
public int getStyleOptions() / public void setStyleOptions(int value) |
getTextWrapping/setTextWrapping | |
public int getTextWrapping() / public void setTextWrapping(int value) |
getTopPadding/setTopPadding | |
public double getTopPadding() / public void setTopPadding(double value) |
Method Detail |
---|
autoFit | |
public void autoFit(int behavior) throws java.lang.Exception |
This method mimics the commands available in the Auto Fit menu for a table in Microsoft Word. The commands available are "Auto Fit to Contents", "Auto Fit to Window" and "Fixed Column Width". In Microsoft Word these commands set relevant table properties and then update the table layout and Aspose.Words does the same for you.
behavior
- A clearBorders | |
public void clearBorders() |
clearShading | |
public void clearShading() |
deepClone | → inherited from Aspose.Words.Node |
public Aspose.Words.Node deepClone(boolean isCloneChildren) |
This method serves as a copy constructor for nodes. The cloned node has no parent, but belongs to the same document as the original node.
This method always performs a deep copy of the node. The isCloneChildren parameter specifies whether to perform copy all child nodes as well.
isCloneChildren
- True to recursively clone the subtree under the specified node;
false to clone only the node itself.ensureMinimum | |
public void ensureMinimum() |
getAncestor | → inherited from Aspose.Words.Node |
public Aspose.Words.CompositeNode getAncestor(java.lang.Class ancestorType) |
The ancestor type matches if it is equal to ancestorType or derived from ancestorType.
ancestorType
- The object type of the ancestor to retrieve.getContainer | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.CompositeNode getContainer() |
getNextMatchingNode | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.Node getNextMatchingNode(aspose.obfuscated.type curNode) |
getText | → inherited from Aspose.Words.CompositeNode |
public java.lang.String getText() |
The returned string includes all control and special characters as described in
iterator | → inherited from Aspose.Words.CompositeNode |
public java.util.Iterator iterator() |
remove | → inherited from Aspose.Words.Node |
public void remove() |
removeAllChildren | → inherited from Aspose.Words.CompositeNode |
public void removeAllChildren() |
removeSmartTags | → inherited from Aspose.Words.CompositeNode |
public void removeSmartTags() |
selectNodes | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.NodeList selectNodes(java.lang.String xpath) |
Only expressions with element names are supported at the moment. Expressions that use attribute names are not supported.
xpath
- The XPath expression.selectSingleNode | → inherited from Aspose.Words.CompositeNode |
public Aspose.Words.Node selectSingleNode(java.lang.String xpath) |
Only expressions with element names are supported at the moment. Expressions that use attribute names are not supported.
xpath
- The XPath expression.toString | → inherited from Aspose.Words.Node |
public java.lang.String toString(SaveOptions saveOptions) throws java.lang.Exception |
saveOptions
- Specifies the options that control how the node is saved.toTxt | → inherited from Aspose.Words.Node |
public java.lang.String toTxt() throws java.lang.Exception |
This method removes field codes and Microsoft Word control characters, uses CrLf
(or any other) combination of characters to mark ends of paragraphs in the resulting string.
It produces a different result from