Table

Overview

Table is a class in Aspose.Words FOSS for Java. Inherits from: CompositeNode<Row>.

Represents a table in a Word document.

Edition status of its 106 listed members (a property and its accessor methods are listed separately, overloads once): 106 not yet exercised by a verified example.

This class declares 73 methods for Table objects in Java programs. Available methods include: Table, accept, acceptEnd, acceptStart, autoFit, clearBorders, clearShading, convertToHorizontallyMergedCells, ensureMinimum, getAbsoluteHorizontalDistance, getAbsoluteVerticalDistance, getAlignment, and 61 additional methods. Public members are accessible to any Java application after installing the Aspose.Words FOSS for Java package. Properties: absoluteHorizontalDistance, absoluteVerticalDistance, alignment, allowAutoFit, allowCellSpacing, allowOverlap, and 27 more.

Properties

NameTypeAccessDescription
nodeTypeintReadReturns Table.
firstRowRowReadReturns the first Row node in the table.
lastRowRowReadReturns the last Row node in the table.
rowsRowCollectionReadProvides typed access to the rows of the table.
alignmentintRead/WriteSpecifies how an inline table is aligned in the document.
allowAutoFitbooleanRead/WriteAllows Microsoft Word and Aspose.Words to automatically resize cells in a table to fit their contents.
preferredWidthPreferredWidthRead/WriteGets or sets the table preferred width.
bidibooleanRead/WriteGets or sets whether this is a right-to-left table.
leftPaddingdoubleRead/WriteGets or sets the amount of space (in points) to add to the left of the contents of cells.
rightPaddingdoubleRead/WriteGets or sets the amount of space (in points) to add to the right of the contents of cells.
topPaddingdoubleRead/WriteGets or sets the amount of space (in points) to add above the contents of cells.
bottomPaddingdoubleRead/WriteGets or sets the amount of space (in points) to add below the contents of cells.
cellSpacingdoubleRead/WriteGets or sets the amount of space (in points) between the cells.
allowCellSpacingbooleanRead/WriteGets or sets the “Allow spacing between cells” option.
leftIndentdoubleRead/WriteGets or sets the value that represents the left indent of the table.
styleOptionsintRead/WriteGets or sets bit flags that specify how a table style is applied to this table.
styleStyleRead/WriteGets or sets the table style applied to this table.
styleNameStringRead/WriteGets or sets the name of the table style applied to this table.
styleIdentifierintRead/WriteGets or sets the locale independent style identifier of the table style applied to this table.
textWrappingintRead/WriteGets or sets TextWrapping for table.
titleStringRead/WriteGets or sets title of this table.
descriptionStringRead/WriteGets or sets description of this table.
distanceLeftdoubleRead/WriteGets or sets distance between table left and the surrounding text, in points.
distanceRightdoubleRead/WriteGets or sets distance between table right and the surrounding text, in points.
distanceTopdoubleRead/WriteGets or sets distance between table top and the surrounding text, in points.
distanceBottomdoubleRead/WriteGets or sets distance between table bottom and the surrounding text, in points.
relativeHorizontalAlignmentintRead/WriteGets or sets floating table relative horizontal alignment.
relativeVerticalAlignmentintRead/WriteGets or sets floating table relative vertical alignment.
horizontalAnchorintRead/WriteGets the base object from which the horizontal positioning of floating table should be calculated.
verticalAnchorintRead/WriteGets the base object from which the vertical positioning of floating table should be calculated.
absoluteHorizontalDistancedoubleRead/WriteGets or sets absolute horizontal floating table position specified by the table properties, in points.
absoluteVerticalDistancedoubleRead/WriteGets or sets absolute vertical floating table position specified by the table properties, in points.
allowOverlapbooleanReadGets whether a floating table shall allow other floating objects in the document to overlap its extents when displayed.

Methods

SignatureDescription
Table(doc: DocumentBase)Initializes a new instance of the Table class.
convertToHorizontallyMergedCells()Converts cells horizontally merged by width to cells merged by CellFormat.getHorizontalMerge().
getNodeType() → intReturns Table.
getFirstRow() → RowReturns the first Row node in the table.
getLastRow() → RowReturns the last Row node in the table.
getRows() → RowCollectionProvides typed access to the rows of the table.
accept(visitor: DocumentVisitor) → booleanCalls accept(visitor) on this Table instance.
acceptStart(visitor: DocumentVisitor) → intAccepts a visitor for visiting the start of the table.
acceptEnd(visitor: DocumentVisitor) → intAccepts a visitor for visiting the end of the table.
ensureMinimum()If the table has no rows, creates and appends one Row.
getAlignment() → intSpecifies how an inline table is aligned in the document.
setAlignment(value: int)Sets the alignment value.
getAllowAutoFit() → booleanAllows Microsoft Word and Aspose.Words to automatically resize cells in a table to fit their contents.
setAllowAutoFit(value: boolean)Sets the allow auto fit value.
getPreferredWidth() → PreferredWidthGets or sets the table preferred width.
setPreferredWidth(value: PreferredWidth)Sets the preferred width value.
getBidi() → booleanGets or sets whether this is a right-to-left table.
setBidi(value: boolean)Sets the bidi value.
getLeftPadding() → doubleGets or sets the amount of space (in points) to add to the left of the contents of cells.
setLeftPadding(value: double)Sets the left padding value.
getRightPadding() → doubleGets or sets the amount of space (in points) to add to the right of the contents of cells.
setRightPadding(value: double)Sets the right padding value.
getTopPadding() → doubleGets or sets the amount of space (in points) to add above the contents of cells.
setTopPadding(value: double)Sets the top padding value.
getBottomPadding() → doubleGets or sets the amount of space (in points) to add below the contents of cells.
setBottomPadding(value: double)Sets the bottom padding value.
getCellSpacing() → doubleGets or sets the amount of space (in points) between the cells.
setCellSpacing(value: double)Sets the cell spacing value.
getAllowCellSpacing() → booleanGets or sets the “Allow spacing between cells” option.
setAllowCellSpacing(value: boolean)Sets the allow cell spacing value.
getLeftIndent() → doubleGets or sets the value that represents the left indent of the table.
setLeftIndent(value: double)Sets the left indent value.
getStyleOptions() → intGets or sets bit flags that specify how a table style is applied to this table.
setStyleOptions(value: int)Sets the style options value.
getStyle() → StyleGets or sets the table style applied to this table.
setStyle(value: Style)Sets the style value.
getStyleName() → StringGets or sets the name of the table style applied to this table.
setStyleName(value: String)Sets the style name value.
getStyleIdentifier() → intGets or sets the locale independent style identifier of the table style applied to this table.
setStyleIdentifier(value: int)Sets the style identifier value.
getTextWrapping() → intGets or sets TextWrapping for table.
setTextWrapping(value: int)Sets the text wrapping value.
getTitle() → StringGets or sets title of this table.
setTitle(value: String)Sets the title value.
getDescription() → StringGets or sets description of this table.
setDescription(value: String)Sets the description value.
getDistanceLeft() → doubleGets or sets distance between table left and the surrounding text, in points.
setDistanceLeft(value: double)Sets the distance left value.
getDistanceRight() → doubleGets or sets distance between table right and the surrounding text, in points.
setDistanceRight(value: double)Sets the distance right value.
getDistanceTop() → doubleGets or sets distance between table top and the surrounding text, in points.
setDistanceTop(value: double)Sets the distance top value.
getDistanceBottom() → doubleGets or sets distance between table bottom and the surrounding text, in points.
setDistanceBottom(value: double)Sets the distance bottom value.
getRelativeHorizontalAlignment() → intGets or sets floating table relative horizontal alignment.
setRelativeHorizontalAlignment(value: int)Sets the relative horizontal alignment value.
getRelativeVerticalAlignment() → intGets or sets floating table relative vertical alignment.
setRelativeVerticalAlignment(value: int)Sets the relative vertical alignment value.
getHorizontalAnchor() → intGets the base object from which the horizontal positioning of floating table should be calculated.
setHorizontalAnchor(value: int)Sets the horizontal anchor value.
getVerticalAnchor() → intGets the base object from which the vertical positioning of floating table should be calculated.
setVerticalAnchor(value: int)Sets the vertical anchor value.
getAbsoluteHorizontalDistance() → doubleGets or sets absolute horizontal floating table position specified by the table properties, in points.
setAbsoluteHorizontalDistance(value: double)Sets the absolute horizontal distance value.
getAbsoluteVerticalDistance() → doubleGets or sets absolute vertical floating table position specified by the table properties, in points.
setAbsoluteVerticalDistance(value: double)Sets the absolute vertical distance value.
getAllowOverlap() → booleanGets whether a floating table shall allow other floating objects in the document to overlap its extents when displayed.
setBorders(lineStyle: int, lineWidth: double, color: Color)Sets all table borders to the specified line style, width and color.
setBorder(borderType: int, lineStyle: int, lineWidth: double, color: Color, isOverrideCellBorders: boolean)Sets the specified table border to the specified line style, width and color.
clearBorders()Removes all table and cell borders on this table.
setShading(texture: int, foregroundColor: Color, backgroundColor: Color)Sets shading to the specified values on whole table.
clearShading()Removes all shading on the table.
autoFit(behavior: int)Resizes the table and cells according to the specified auto fit behavior.

See Also