Table

Inheritance: java.lang.Object, com.aspose.words.Node, com.aspose.words.CompositeNode

public class Table extends CompositeNode

Represents a table in a Word document.

To learn more, visit the Working with Tables documentation article.

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.

Constructors

Constructor Description
Table(DocumentBase doc) Initializes a new instance of the Table class.

Methods

Method Description
accept(DocumentVisitor visitor) Accepts a visitor.
appendChild(Node newChild) Adds the specified node to the end of the list of child nodes for this node.
autoFit(int behavior)
clearBorders() Removes all table and cell borders on this table.
clearShading() Removes all shading on the table.
convertToHorizontallyMergedCells() Converts cells horizontally merged by width to cells merged by CellFormat.getHorizontalMerge() / CellFormat.setHorizontalMerge(int).
dd()
deepClone(boolean isCloneChildren) Creates a duplicate of the node.
ensureMinimum() If the table has no rows, creates and appends one Row.
equals(Object arg0)
getAbsoluteHorizontalDistance() Gets absolute horizontal floating table position specified by the table properties, in points.
getAbsoluteVerticalDistance() Gets absolute vertical floating table position specified by the table properties, in points.
getAlignment() Specifies how an inline table is aligned in the document.
getAllowAutoFit() Allows Microsoft Word and Aspose.Words to automatically resize cells in a table to fit their contents.
getAllowCellSpacing() Gets the “Allow spacing between cells” option.
getAllowOverlap() Gets whether a floating table shall allow other floating objects in the document to overlap its extents when displayed.
getAncestor(int ancestorType)
getAncestor(Class ancestorType) Gets the first ancestor of the specified object type.
getBidi() Gets whether this is a right-to-left table.
getBottomPadding() Gets the amount of space (in points) to add below the contents of cells.
getCellSpacing() Gets the amount of space (in points) between the cells.
getChild(int nodeType, int index, boolean isDeep)
getChildNodes() Gets all immediate child nodes of this node.
getChildNodes(int nodeType, boolean isDeep)
getClass()
getContainer()
getCount() Gets the number of immediate children of this node.
getCurrentNode()
getCustomNodeId() Specifies custom node identifier.
getDescription() Gets description of this table.
getDistanceBottom() Gets distance between table bottom and the surrounding text, in points.
getDistanceLeft() Gets distance between table left and the surrounding text, in points.
getDistanceRight() Gets distance between table right and the surrounding text, in points.
getDistanceTop() Gets distance between table top and the surrounding text, in points.
getDocument() Gets the document to which this node belongs.
getFirstChild() Gets the first child of the node.
getFirstRow() Returns the first Row node in the table.
getHorizontalAnchor() Gets the base object from which the horizontal positioning of floating table should be calculated.
getLastChild() Gets the last child of the node.
getLastRow() Returns the last Row node in the table.
getLeftIndent() Gets the value that represents the left indent of the table.
getLeftPadding() Gets the amount of space (in points) to add to the left of the contents of cells.
getNextMatchingNode(Node curNode)
getNextSibling() Gets the node immediately following this node.
getNodeType() Returns NodeType.Table.
getParentNode() Gets the immediate parent of this node.
getPreferredWidth() Gets the table preferred width.
getPreviousSibling() Gets the node immediately preceding this node.
getRange() Returns a Range object that represents the portion of a document that is contained in this node.
getRelativeHorizontalAlignment() Gets floating table relative horizontal alignment.
getRelativeVerticalAlignment() Gets floating table relative vertical alignment.
getRightPadding() Gets the amount of space (in points) to add to the right of the contents of cells.
getRows() Provides typed access to the rows of the table.
getStyle() Gets the table style applied to this table.
getStyleIdentifier() Gets the locale independent style identifier of the table style applied to this table.
getStyleName() Gets the name of the table style applied to this table.
getStyleOptions() Gets bit flags that specify how a table style is applied to this table.
getText() Gets the text of this node and of all its children.
getTextWrapping() Gets getTextWrapping() / setTextWrapping(int) for table.
getTitle() Gets title of this table.
getTopPadding() Gets the amount of space (in points) to add above the contents of cells.
getVerticalAnchor() Gets the base object from which the vertical positioning of floating table should be calculated.
hasChildNodes() Returns true if this node has any child nodes.
hashCode()
indexOf(Node child) Returns the index of the specified child node in the child node array.
insertAfter(Node newChild, Node refChild) Inserts the specified node immediately after the specified reference node.
insertBefore(Node newChild, Node refChild) Inserts the specified node immediately before the specified reference node.
isComposite() Returns true as this node can have child nodes.
iterator() Provides support for the for each style iteration over the child nodes of this node.
nextPreOrder(Node rootNode) Gets next node according to the pre-order tree traversal algorithm.
nodeTypeToString(int nodeType)
notify()
notifyAll()
prependChild(Node newChild) Adds the specified node to the beginning of the list of child nodes for this node.
previousPreOrder(Node rootNode) Gets the previous node according to the pre-order tree traversal algorithm.
remove() Removes itself from the parent.
removeAllChildren() Removes all the child nodes of the current node.
removeChild(Node oldChild) Removes the specified child node.
removeSmartTags() Removes all SmartTag descendant nodes of the current node.
selectNodes(String xpath) Selects a list of nodes matching the XPath expression.
selectSingleNode(String xpath) Selects the first Node that matches the XPath expression.
setAbsoluteHorizontalDistance(double value) Sets absolute horizontal floating table position specified by the table properties, in points.
setAbsoluteVerticalDistance(double value) Sets absolute vertical floating table position specified by the table properties, in points.
setAlignment(int value) Specifies how an inline table is aligned in the document.
setAllowAutoFit(boolean value) Allows Microsoft Word and Aspose.Words to automatically resize cells in a table to fit their contents.
setAllowCellSpacing(boolean value) Sets the “Allow spacing between cells” option.
setBidi(boolean value) Sets whether this is a right-to-left table.
setBorder(int borderType, int lineStyle, double lineWidth, Color color, boolean isOverrideCellBorders)
setBorders(int lineStyle, double lineWidth, Color color)
setBottomPadding(double value) Sets the amount of space (in points) to add below the contents of cells.
setCellSpacing(double value) Sets the amount of space (in points) between the cells.
setCustomNodeId(int value) Specifies custom node identifier.
setDescription(String value) Sets description of this table.
setHorizontalAnchor(int value) Gets the base object from which the horizontal positioning of floating table should be calculated.
setLeftIndent(double value) Sets the value that represents the left indent of the table.
setLeftPadding(double value) Sets the amount of space (in points) to add to the left of the contents of cells.
setPreferredWidth(PreferredWidth value) Sets the table preferred width.
setRelativeHorizontalAlignment(int value) Sets floating table relative horizontal alignment.
setRelativeVerticalAlignment(int value) Sets floating table relative vertical alignment.
setRightPadding(double value) Sets the amount of space (in points) to add to the right of the contents of cells.
setShading(int texture, Color foregroundColor, Color backgroundColor)
setStyle(Style value) Sets the table style applied to this table.
setStyleIdentifier(int value) Sets the locale independent style identifier of the table style applied to this table.
setStyleName(String value) Sets the name of the table style applied to this table.
setStyleOptions(int value) Sets bit flags that specify how a table style is applied to this table.
setTextWrapping(int value) Sets getTextWrapping() / setTextWrapping(int) for table.
setTitle(String value) Sets title of this table.
setTopPadding(double value) Sets the amount of space (in points) to add above the contents of cells.
setVerticalAnchor(int value) Gets the base object from which the vertical positioning of floating table should be calculated.
toString()
toString(SaveOptions saveOptions) Exports the content of the node into a string using the specified save options.
toString(int saveFormat)
wait()
wait(long arg0)
wait(long arg0, int arg1)

Table(DocumentBase doc)

public Table(DocumentBase doc)

Initializes a new instance of the Table class.

When Table is created, it belongs to the specified document, but is not yet part of the document and ParentNode is null.

To append Table to the document use InsertAfter or InsertBefore on the story where you want the table inserted.

Parameters:

Parameter Type Description
doc DocumentBase The owner document.

accept(DocumentVisitor visitor)

public boolean accept(DocumentVisitor visitor)

Accepts a visitor.

Enumerates over this node and all of its children. Each node calls a corresponding method on DocumentVisitor.

For more info see the Visitor design pattern.

Parameters:

Parameter Type Description
visitor DocumentVisitor The visitor that will visit the nodes.

Returns: boolean - True if all nodes were visited; false if DocumentVisitor stopped the operation before visiting all nodes. Calls DocumentVisitor.VisitTableStart, then calls Accept for all child nodes of the section and calls DocumentVisitor.VisitTableEnd at the end.

appendChild(Node newChild)

public Node appendChild(Node newChild)

Adds the specified node to the end of the list of child nodes for this node.

If the newChild is already in the tree, it is first removed.

If the node being inserted was created from another document, you should use M:Aspose.Words.DocumentBase.ImportNode(Aspose.Words.Node,System.Boolean,Aspose.Words.ImportFormatMode) to import the node to the current document. The imported node can then be inserted into the current document.

Parameters:

Parameter Type Description
newChild Node The node to add.

Returns: Node - The node added.

autoFit(int behavior)

public void autoFit(int behavior)

Parameters:

Parameter Type Description
behavior int

clearBorders()

public void clearBorders()

Removes all table and cell borders on this table.

clearShading()

public void clearShading()

Removes all shading on the table.

convertToHorizontallyMergedCells()

public void convertToHorizontallyMergedCells()

Converts cells horizontally merged by width to cells merged by CellFormat.getHorizontalMerge() / CellFormat.setHorizontalMerge(int).

Table cells can be horizontally merged either using merge flags CellFormat.getHorizontalMerge() / CellFormat.setHorizontalMerge(int) or using cell width CellFormat.getWidth() / CellFormat.setWidth(double).

When table cell is merged by width property CellFormat.getHorizontalMerge() / CellFormat.setHorizontalMerge(int) is meaningless but sometimes having merge flags is more convenient way.

Use this method to transforms table cells horizontally merged by width to cells merged by merge flags.

dd()

public void dd()

deepClone(boolean isCloneChildren)

public Node deepClone(boolean isCloneChildren)

Creates a duplicate of the node.

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.

Parameters:

Parameter Type Description
isCloneChildren boolean True to recursively clone the subtree under the specified node; false to clone only the node itself.

Returns: Node - The cloned node.

ensureMinimum()

public void ensureMinimum()

If the table has no rows, creates and appends one Row.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

Parameter Type Description
arg0 java.lang.Object

Returns: boolean

getAbsoluteHorizontalDistance()

public double getAbsoluteHorizontalDistance()

Gets absolute horizontal floating table position specified by the table properties, in points. Default value is 0.

Returns: double - Absolute horizontal floating table position specified by the table properties, in points.

getAbsoluteVerticalDistance()

public double getAbsoluteVerticalDistance()

Gets absolute vertical floating table position specified by the table properties, in points. Default value is 0.

Returns: double - Absolute vertical floating table position specified by the table properties, in points.

getAlignment()

public int getAlignment()

Specifies how an inline table is aligned in the document.

The default value is TableAlignment.LEFT.

Returns: int - The corresponding int value. The returned value is one of TableAlignment constants.

getAllowAutoFit()

public boolean getAllowAutoFit()

Allows Microsoft Word and Aspose.Words to automatically resize cells in a table to fit their contents.

The default value is true .

M:Aspose.Words.Tables.Table.AutoFit(Aspose.Words.Tables.AutoFitBehavior)

Returns: boolean - The corresponding boolean value.

getAllowCellSpacing()

public boolean getAllowCellSpacing()

Gets the “Allow spacing between cells” option.

Returns: boolean - The “Allow spacing between cells” option.

getAllowOverlap()

public boolean getAllowOverlap()

Gets whether a floating table shall allow other floating objects in the document to overlap its extents when displayed. Default value is true .

Returns: boolean - Whether a floating table shall allow other floating objects in the document to overlap its extents when displayed.

getAncestor(int ancestorType)

public CompositeNode getAncestor(int ancestorType)

Parameters:

Parameter Type Description
ancestorType int

Returns: CompositeNode

getAncestor(Class ancestorType)

public CompositeNode getAncestor(Class ancestorType)

Gets the first ancestor of the specified object type.

Parameters:

Parameter Type Description
ancestorType java.lang.Class The object type of the ancestor to retrieve.

Returns: CompositeNode - The ancestor of the specified type or null if no ancestor of this type was found.

The ancestor type matches if it is equal to ancestorType or derived from ancestorType.

getBidi()

public boolean getBidi()

Gets whether this is a right-to-left table.

When true , the cells in this row are laid out right to left.

The default value is false .

Returns: boolean - Whether this is a right-to-left table.

getBottomPadding()

public double getBottomPadding()

Gets the amount of space (in points) to add below the contents of cells.

Returns: double - The amount of space (in points) to add below the contents of cells.

getCellSpacing()

public double getCellSpacing()

Gets the amount of space (in points) between the cells.

Returns: double - The amount of space (in points) between the cells.

getChild(int nodeType, int index, boolean isDeep)

public Node getChild(int nodeType, int index, boolean isDeep)

Parameters:

Parameter Type Description
nodeType int
index int
isDeep boolean

Returns: Node

getChildNodes()

public NodeCollection getChildNodes()

Gets all immediate child nodes of this node.

Note, getChildNodes() is equivalent to calling 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.

Returns: NodeCollection - All immediate child nodes of this node.

getChildNodes(int nodeType, boolean isDeep)

public NodeCollection getChildNodes(int nodeType, boolean isDeep)

Parameters:

Parameter Type Description
nodeType int
isDeep boolean

Returns: NodeCollection

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getContainer()

public CompositeNode getContainer()

Returns: CompositeNode

getCount()

public int getCount()

Gets the number of immediate children of this node.

Returns: int - The number of immediate children of this node.

getCurrentNode()

public Node getCurrentNode()

Returns: Node

getCustomNodeId()

public int getCustomNodeId()

Specifies custom node identifier.

Default is zero.

This identifier can be set and used arbitrarily. For example, as a key to get external data.

Important note, specified value is not saved to an output file and exists only during the node lifetime.

Returns: int - The corresponding int value.

getDescription()

public String getDescription()

Gets description of this table. It provides an alternative text representation of the information contained in the table.

The default value is an empty string.

This property is meaningful for ISO/IEC 29500 compliant DOCX documents ( OoxmlCompliance). When saved to pre-ISO/IEC 29500 formats, the property is ignored.

Returns: java.lang.String - Description of this table.

getDistanceBottom()

public double getDistanceBottom()

Gets distance between table bottom and the surrounding text, in points.

Returns: double - Distance between table bottom and the surrounding text, in points.

getDistanceLeft()

public double getDistanceLeft()

Gets distance between table left and the surrounding text, in points.

Returns: double - Distance between table left and the surrounding text, in points.

getDistanceRight()

public double getDistanceRight()

Gets distance between table right and the surrounding text, in points.

Returns: double - Distance between table right and the surrounding text, in points.

getDistanceTop()

public double getDistanceTop()

Gets distance between table top and the surrounding text, in points.

Returns: double - Distance between table top and the surrounding text, in points.

getDocument()

public DocumentBase getDocument()

Gets the document to which this node belongs.

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.

Returns: DocumentBase - The document to which this node belongs.

getFirstChild()

public Node getFirstChild()

Gets the first child of the node. If there is no first child node, a null is returned.

Returns: Node - The first child of the node.

getFirstRow()

public Row getFirstRow()

Returns the first Row node in the table.

Returns: Row - The first Row node in the table.

getHorizontalAnchor()

public int getHorizontalAnchor()

Gets the base object from which the horizontal positioning of floating table should be calculated. Default value is RelativeHorizontalPosition.COLUMN.

Returns: int - The base object from which the horizontal positioning of floating table should be calculated. The returned value is one of RelativeHorizontalPosition constants.

getLastChild()

public Node getLastChild()

Gets the last child of the node. If there is no last child node, a null is returned.

Returns: Node - The last child of the node.

getLastRow()

public Row getLastRow()

Returns the last Row node in the table.

Returns: Row - The last Row node in the table.

getLeftIndent()

public double getLeftIndent()

Gets the value that represents the left indent of the table.

Returns: double - The value that represents the left indent of the table.

getLeftPadding()

public double getLeftPadding()

Gets the amount of space (in points) to add to the left of the contents of cells.

Returns: double - The amount of space (in points) to add to the left of the contents of cells.

getNextMatchingNode(Node curNode)

public Node getNextMatchingNode(Node curNode)

Parameters:

Parameter Type Description
curNode Node

Returns: Node

getNextSibling()

public Node getNextSibling()

Gets the node immediately following this node. If there is no next node, a null is returned.

Returns: Node - The node immediately following this node.

getNodeType()

public int getNodeType()

Returns NodeType.Table.

Returns: int - NodeType.Table. The returned value is one of NodeType constants.

getParentNode()

public CompositeNode getParentNode()

Gets the immediate parent of this node.

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.

Returns: CompositeNode - The immediate parent of this node.

getPreferredWidth()

public PreferredWidth getPreferredWidth()

Gets the table preferred width.

The default value is PreferredWidth.AUTO.

Returns: PreferredWidth - The table preferred width.

getPreviousSibling()

public Node getPreviousSibling()

Gets the node immediately preceding this node. If there is no preceding node, a null is returned.

Returns: Node - The node immediately preceding this node.

getRange()

public Range getRange()

Returns a Range object that represents the portion of a document that is contained in this node.

Returns: Range - A Range object that represents the portion of a document that is contained in this node.

getRelativeHorizontalAlignment()

public int getRelativeHorizontalAlignment()

Gets floating table relative horizontal alignment.

Returns: int - Floating table relative horizontal alignment. The returned value is one of HorizontalAlignment constants.

getRelativeVerticalAlignment()

public int getRelativeVerticalAlignment()

Gets floating table relative vertical alignment.

Returns: int - Floating table relative vertical alignment. The returned value is one of VerticalAlignment constants.

getRightPadding()

public double getRightPadding()

Gets the amount of space (in points) to add to the right of the contents of cells.

Returns: double - The amount of space (in points) to add to the right of the contents of cells.

getRows()

public RowCollection getRows()

Provides typed access to the rows of the table.

Returns: RowCollection - The corresponding RowCollection value.

getStyle()

public Style getStyle()

Gets the table style applied to this table.

Returns: Style - The table style applied to this table.

getStyleIdentifier()

public int getStyleIdentifier()

Gets the locale independent style identifier of the table style applied to this table.

Returns: int - The locale independent style identifier of the table style applied to this table. The returned value is one of StyleIdentifier constants.

getStyleName()

public String getStyleName()

Gets the name of the table style applied to this table.

Returns: java.lang.String - The name of the table style applied to this table.

getStyleOptions()

public int getStyleOptions()

Gets bit flags that specify how a table style is applied to this table.

Returns: int - Bit flags that specify how a table style is applied to this table. The returned value is a bitwise combination of TableStyleOptions constants.

getText()

public String getText()

Gets the text of this node and of all its children.

The returned string includes all control and special characters as described in ControlChar.

Returns: java.lang.String

getTextWrapping()

public int getTextWrapping()

Gets getTextWrapping() / setTextWrapping(int) for table.

Returns: int - {getTextWrapping() / setTextWrapping(int) for table. The returned value is one of TextWrapping constants.

getTitle()

public String getTitle()

Gets title of this table. It provides an alternative text representation of the information contained in the table.

The default value is an empty string.

This property is meaningful for ISO/IEC 29500 compliant DOCX documents ( OoxmlCompliance). When saved to pre-ISO/IEC 29500 formats, the property is ignored.

Returns: java.lang.String - Title of this table.

getTopPadding()

public double getTopPadding()

Gets the amount of space (in points) to add above the contents of cells.

Returns: double - The amount of space (in points) to add above the contents of cells.

getVerticalAnchor()

public int getVerticalAnchor()

Gets the base object from which the vertical positioning of floating table should be calculated. Default value is RelativeVerticalPosition.MARGIN.

Returns: int - The base object from which the vertical positioning of floating table should be calculated. The returned value is one of RelativeVerticalPosition constants.

hasChildNodes()

public boolean hasChildNodes()

Returns true if this node has any child nodes.

Returns: boolean - True if this node has any child nodes.

hashCode()

public native int hashCode()

Returns: int

indexOf(Node child)

public int indexOf(Node child)

Returns the index of the specified child node in the child node array. Returns -1 if the node is not found in the child nodes.

Parameters:

Parameter Type Description
child Node

Returns: int

insertAfter(Node newChild, Node refChild)

public Node insertAfter(Node newChild, Node refChild)

Inserts the specified node immediately after the specified reference node.

If refChild is null, inserts newChild at the beginning of the list of child nodes.

If the newChild is already in the tree, it is first removed.

If the node being inserted was created from another document, you should use M:Aspose.Words.DocumentBase.ImportNode(Aspose.Words.Node,System.Boolean,Aspose.Words.ImportFormatMode) to import the node to the current document. The imported node can then be inserted into the current document.

Parameters:

Parameter Type Description
newChild Node The Node to insert.
refChild Node The Node that is the reference node. The newNode is placed after the refNode.

Returns: Node - The inserted node.

insertBefore(Node newChild, Node refChild)

public Node insertBefore(Node newChild, Node refChild)

Inserts the specified node immediately before the specified reference node.

If refChild is null, inserts newChild at the end of the list of child nodes.

If the newChild is already in the tree, it is first removed.

If the node being inserted was created from another document, you should use M:Aspose.Words.DocumentBase.ImportNode(Aspose.Words.Node,System.Boolean,Aspose.Words.ImportFormatMode) to import the node to the current document. The imported node can then be inserted into the current document.

Parameters:

Parameter Type Description
newChild Node The Node to insert.
refChild Node The Node that is the reference node. The newChild is placed before this node.

Returns: Node - The inserted node.

isComposite()

public boolean isComposite()

Returns true as this node can have child nodes.

Returns: boolean - True as this node can have child nodes.

iterator()

public Iterator iterator()

Provides support for the for each style iteration over the child nodes of this node.

Returns: java.util.Iterator

nextPreOrder(Node rootNode)

public Node nextPreOrder(Node rootNode)

Gets next node according to the pre-order tree traversal algorithm.

Parameters:

Parameter Type Description
rootNode Node The top node (limit) of traversal.

Returns: Node - Next node in pre-order order. Null if reached the rootNode.

nodeTypeToString(int nodeType)

public static String nodeTypeToString(int nodeType)

Parameters:

Parameter Type Description
nodeType int

Returns: java.lang.String

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

prependChild(Node newChild)

public Node prependChild(Node newChild)

Adds the specified node to the beginning of the list of child nodes for this node.

If the newChild is already in the tree, it is first removed.

If the node being inserted was created from another document, you should use M:Aspose.Words.DocumentBase.ImportNode(Aspose.Words.Node,System.Boolean,Aspose.Words.ImportFormatMode) to import the node to the current document. The imported node can then be inserted into the current document.

Parameters:

Parameter Type Description
newChild Node The node to add.

Returns: Node - The node added.

previousPreOrder(Node rootNode)

public Node previousPreOrder(Node rootNode)

Gets the previous node according to the pre-order tree traversal algorithm.

Parameters:

Parameter Type Description
rootNode Node The top node (limit) of traversal.

Returns: Node - Previous node in pre-order order. Null if reached the rootNode.

remove()

public void remove()

Removes itself from the parent.

removeAllChildren()

public void removeAllChildren()

Removes all the child nodes of the current node.

removeChild(Node oldChild)

public Node removeChild(Node oldChild)

Removes the specified child node.

The parent of oldChild is set to null after the node is removed.

Parameters:

Parameter Type Description
oldChild Node The node to remove.

Returns: Node - The removed node.

removeSmartTags()

public void removeSmartTags()

Removes all SmartTag descendant nodes of the current node. This method does not remove the content of the smart tags.

selectNodes(String xpath)

public NodeList selectNodes(String xpath)

Selects a list of nodes matching the XPath expression.

Only expressions with element names are supported at the moment. Expressions that use attribute names are not supported.

Parameters:

Parameter Type Description
xpath java.lang.String The XPath expression.

Returns: NodeList - A list of nodes matching the XPath query.

selectSingleNode(String xpath)

public Node selectSingleNode(String xpath)

Selects the first Node that matches the XPath expression.

Only expressions with element names are supported at the moment. Expressions that use attribute names are not supported.

Parameters:

Parameter Type Description
xpath java.lang.String The XPath expression.

Returns: Node - The first Node that matches the XPath query or null if no matching node is found.

setAbsoluteHorizontalDistance(double value)

public void setAbsoluteHorizontalDistance(double value)

Sets absolute horizontal floating table position specified by the table properties, in points. Default value is 0.

Parameters:

Parameter Type Description
value double Absolute horizontal floating table position specified by the table properties, in points.

setAbsoluteVerticalDistance(double value)

public void setAbsoluteVerticalDistance(double value)

Sets absolute vertical floating table position specified by the table properties, in points. Default value is 0.

Parameters:

Parameter Type Description
value double Absolute vertical floating table position specified by the table properties, in points.

setAlignment(int value)

public void setAlignment(int value)

Specifies how an inline table is aligned in the document.

The default value is TableAlignment.LEFT.

Parameters:

Parameter Type Description
value int The corresponding int value. The value must be one of TableAlignment constants.

setAllowAutoFit(boolean value)

public void setAllowAutoFit(boolean value)

Allows Microsoft Word and Aspose.Words to automatically resize cells in a table to fit their contents.

The default value is true .

M:Aspose.Words.Tables.Table.AutoFit(Aspose.Words.Tables.AutoFitBehavior)

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setAllowCellSpacing(boolean value)

public void setAllowCellSpacing(boolean value)

Sets the “Allow spacing between cells” option.

Parameters:

Parameter Type Description
value boolean The “Allow spacing between cells” option.

setBidi(boolean value)

public void setBidi(boolean value)

Sets whether this is a right-to-left table.

When true , the cells in this row are laid out right to left.

The default value is false .

Parameters:

Parameter Type Description
value boolean Whether this is a right-to-left table.

setBorder(int borderType, int lineStyle, double lineWidth, Color color, boolean isOverrideCellBorders)

public void setBorder(int borderType, int lineStyle, double lineWidth, Color color, boolean isOverrideCellBorders)

Parameters:

Parameter Type Description
borderType int
lineStyle int
lineWidth double
color java.awt.Color
isOverrideCellBorders boolean

setBorders(int lineStyle, double lineWidth, Color color)

public void setBorders(int lineStyle, double lineWidth, Color color)

Parameters:

Parameter Type Description
lineStyle int
lineWidth double
color java.awt.Color

setBottomPadding(double value)

public void setBottomPadding(double value)

Sets the amount of space (in points) to add below the contents of cells.

Parameters:

Parameter Type Description
value double The amount of space (in points) to add below the contents of cells.

setCellSpacing(double value)

public void setCellSpacing(double value)

Sets the amount of space (in points) between the cells.

Parameters:

Parameter Type Description
value double The amount of space (in points) between the cells.

setCustomNodeId(int value)

public void setCustomNodeId(int value)

Specifies custom node identifier.

Default is zero.

This identifier can be set and used arbitrarily. For example, as a key to get external data.

Important note, specified value is not saved to an output file and exists only during the node lifetime.

Parameters:

Parameter Type Description
value int The corresponding int value.

setDescription(String value)

public void setDescription(String value)

Sets description of this table. It provides an alternative text representation of the information contained in the table.

The default value is an empty string.

This property is meaningful for ISO/IEC 29500 compliant DOCX documents ( OoxmlCompliance). When saved to pre-ISO/IEC 29500 formats, the property is ignored.

Parameters:

Parameter Type Description
value java.lang.String Description of this table.

setHorizontalAnchor(int value)

public void setHorizontalAnchor(int value)

Gets the base object from which the horizontal positioning of floating table should be calculated. Default value is RelativeHorizontalPosition.COLUMN.

Parameters:

Parameter Type Description
value int The base object from which the horizontal positioning of floating table should be calculated. The value must be one of RelativeHorizontalPosition constants.

setLeftIndent(double value)

public void setLeftIndent(double value)

Sets the value that represents the left indent of the table.

Parameters:

Parameter Type Description
value double The value that represents the left indent of the table.

setLeftPadding(double value)

public void setLeftPadding(double value)

Sets the amount of space (in points) to add to the left of the contents of cells.

Parameters:

Parameter Type Description
value double The amount of space (in points) to add to the left of the contents of cells.

setPreferredWidth(PreferredWidth value)

public void setPreferredWidth(PreferredWidth value)

Sets the table preferred width.

The default value is PreferredWidth.AUTO.

Parameters:

Parameter Type Description
value PreferredWidth The table preferred width.

setRelativeHorizontalAlignment(int value)

public void setRelativeHorizontalAlignment(int value)

Sets floating table relative horizontal alignment.

Parameters:

Parameter Type Description
value int Floating table relative horizontal alignment. The value must be one of HorizontalAlignment constants.

setRelativeVerticalAlignment(int value)

public void setRelativeVerticalAlignment(int value)

Sets floating table relative vertical alignment.

Parameters:

Parameter Type Description
value int Floating table relative vertical alignment. The value must be one of VerticalAlignment constants.

setRightPadding(double value)

public void setRightPadding(double value)

Sets the amount of space (in points) to add to the right of the contents of cells.

Parameters:

Parameter Type Description
value double The amount of space (in points) to add to the right of the contents of cells.

setShading(int texture, Color foregroundColor, Color backgroundColor)

public void setShading(int texture, Color foregroundColor, Color backgroundColor)

Parameters:

Parameter Type Description
texture int
foregroundColor java.awt.Color
backgroundColor java.awt.Color

setStyle(Style value)

public void setStyle(Style value)

Sets the table style applied to this table.

Parameters:

Parameter Type Description
value Style The table style applied to this table.

setStyleIdentifier(int value)

public void setStyleIdentifier(int value)

Sets the locale independent style identifier of the table style applied to this table.

Parameters:

Parameter Type Description
value int The locale independent style identifier of the table style applied to this table. The value must be one of StyleIdentifier constants.

setStyleName(String value)

public void setStyleName(String value)

Sets the name of the table style applied to this table.

Parameters:

Parameter Type Description
value java.lang.String The name of the table style applied to this table.

setStyleOptions(int value)

public void setStyleOptions(int value)

Sets bit flags that specify how a table style is applied to this table.

Parameters:

Parameter Type Description
value int Bit flags that specify how a table style is applied to this table. The value must be a bitwise combination of TableStyleOptions constants.

setTextWrapping(int value)

public void setTextWrapping(int value)

Sets getTextWrapping() / setTextWrapping(int) for table.

Parameters:

Parameter Type Description
value int {getTextWrapping() / setTextWrapping(int) for table. The value must be one of TextWrapping constants.

setTitle(String value)

public void setTitle(String value)

Sets title of this table. It provides an alternative text representation of the information contained in the table.

The default value is an empty string.

This property is meaningful for ISO/IEC 29500 compliant DOCX documents ( OoxmlCompliance). When saved to pre-ISO/IEC 29500 formats, the property is ignored.

Parameters:

Parameter Type Description
value java.lang.String Title of this table.

setTopPadding(double value)

public void setTopPadding(double value)

Sets the amount of space (in points) to add above the contents of cells.

Parameters:

Parameter Type Description
value double The amount of space (in points) to add above the contents of cells.

setVerticalAnchor(int value)

public void setVerticalAnchor(int value)

Gets the base object from which the vertical positioning of floating table should be calculated. Default value is RelativeVerticalPosition.MARGIN.

Parameters:

Parameter Type Description
value int The base object from which the vertical positioning of floating table should be calculated. The value must be one of RelativeVerticalPosition constants.

toString()

public String toString()

Returns: java.lang.String

toString(SaveOptions saveOptions)

public String toString(SaveOptions saveOptions)

Exports the content of the node into a string using the specified save options.

Parameters:

Parameter Type Description
saveOptions SaveOptions Specifies the options that control how the node is saved.

Returns: java.lang.String - The content of the node in the specified format.

toString(int saveFormat)

public String toString(int saveFormat)

Parameters:

Parameter Type Description
saveFormat int

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

Parameter Type Description
arg0 long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

Parameter Type Description
arg0 long
arg1 int