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
| Name | Type | Access | Description |
|---|---|---|---|
nodeType | int | Read | Returns Table. |
firstRow | Row | Read | Returns the first Row node in the table. |
lastRow | Row | Read | Returns the last Row node in the table. |
rows | RowCollection | Read | Provides typed access to the rows of the table. |
alignment | int | Read/Write | Specifies how an inline table is aligned in the document. |
allowAutoFit | boolean | Read/Write | Allows Microsoft Word and Aspose.Words to automatically resize cells in a table to fit their contents. |
preferredWidth | PreferredWidth | Read/Write | Gets or sets the table preferred width. |
bidi | boolean | Read/Write | Gets or sets whether this is a right-to-left table. |
leftPadding | double | Read/Write | Gets or sets the amount of space (in points) to add to the left of the contents of cells. |
rightPadding | double | Read/Write | Gets or sets the amount of space (in points) to add to the right of the contents of cells. |
topPadding | double | Read/Write | Gets or sets the amount of space (in points) to add above the contents of cells. |
bottomPadding | double | Read/Write | Gets or sets the amount of space (in points) to add below the contents of cells. |
cellSpacing | double | Read/Write | Gets or sets the amount of space (in points) between the cells. |
allowCellSpacing | boolean | Read/Write | Gets or sets the “Allow spacing between cells” option. |
leftIndent | double | Read/Write | Gets or sets the value that represents the left indent of the table. |
styleOptions | int | Read/Write | Gets or sets bit flags that specify how a table style is applied to this table. |
style | Style | Read/Write | Gets or sets the table style applied to this table. |
styleName | String | Read/Write | Gets or sets the name of the table style applied to this table. |
styleIdentifier | int | Read/Write | Gets or sets the locale independent style identifier of the table style applied to this table. |
textWrapping | int | Read/Write | Gets or sets TextWrapping for table. |
title | String | Read/Write | Gets or sets title of this table. |
description | String | Read/Write | Gets or sets description of this table. |
distanceLeft | double | Read/Write | Gets or sets distance between table left and the surrounding text, in points. |
distanceRight | double | Read/Write | Gets or sets distance between table right and the surrounding text, in points. |
distanceTop | double | Read/Write | Gets or sets distance between table top and the surrounding text, in points. |
distanceBottom | double | Read/Write | Gets or sets distance between table bottom and the surrounding text, in points. |
relativeHorizontalAlignment | int | Read/Write | Gets or sets floating table relative horizontal alignment. |
relativeVerticalAlignment | int | Read/Write | Gets or sets floating table relative vertical alignment. |
horizontalAnchor | int | Read/Write | Gets the base object from which the horizontal positioning of floating table should be calculated. |
verticalAnchor | int | Read/Write | Gets the base object from which the vertical positioning of floating table should be calculated. |
absoluteHorizontalDistance | double | Read/Write | Gets or sets absolute horizontal floating table position specified by the table properties, in points. |
absoluteVerticalDistance | double | Read/Write | Gets or sets absolute vertical floating table position specified by the table properties, in points. |
allowOverlap | boolean | Read | Gets whether a floating table shall allow other floating objects in the document to overlap its extents when displayed. |
Methods
| Signature | Description |
|---|---|
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() → int | Returns Table. |
getFirstRow() → Row | Returns the first Row node in the table. |
getLastRow() → Row | Returns the last Row node in the table. |
getRows() → RowCollection | Provides typed access to the rows of the table. |
accept(visitor: DocumentVisitor) → boolean | Calls accept(visitor) on this Table instance. |
acceptStart(visitor: DocumentVisitor) → int | Accepts a visitor for visiting the start of the table. |
acceptEnd(visitor: DocumentVisitor) → int | Accepts a visitor for visiting the end of the table. |
ensureMinimum() | If the table has no rows, creates and appends one Row. |
getAlignment() → int | Specifies how an inline table is aligned in the document. |
setAlignment(value: int) | Sets the alignment value. |
getAllowAutoFit() → boolean | Allows 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() → PreferredWidth | Gets or sets the table preferred width. |
setPreferredWidth(value: PreferredWidth) | Sets the preferred width value. |
getBidi() → boolean | Gets or sets whether this is a right-to-left table. |
setBidi(value: boolean) | Sets the bidi value. |
getLeftPadding() → double | Gets 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() → double | Gets 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() → double | Gets or sets the amount of space (in points) to add above the contents of cells. |
setTopPadding(value: double) | Sets the top padding value. |
getBottomPadding() → double | Gets or sets the amount of space (in points) to add below the contents of cells. |
setBottomPadding(value: double) | Sets the bottom padding value. |
getCellSpacing() → double | Gets or sets the amount of space (in points) between the cells. |
setCellSpacing(value: double) | Sets the cell spacing value. |
getAllowCellSpacing() → boolean | Gets or sets the “Allow spacing between cells” option. |
setAllowCellSpacing(value: boolean) | Sets the allow cell spacing value. |
getLeftIndent() → double | Gets or sets the value that represents the left indent of the table. |
setLeftIndent(value: double) | Sets the left indent value. |
getStyleOptions() → int | Gets or sets bit flags that specify how a table style is applied to this table. |
setStyleOptions(value: int) | Sets the style options value. |
getStyle() → Style | Gets or sets the table style applied to this table. |
setStyle(value: Style) | Sets the style value. |
getStyleName() → String | Gets or sets the name of the table style applied to this table. |
setStyleName(value: String) | Sets the style name value. |
getStyleIdentifier() → int | Gets or sets the locale independent style identifier of the table style applied to this table. |
setStyleIdentifier(value: int) | Sets the style identifier value. |
getTextWrapping() → int | Gets or sets TextWrapping for table. |
setTextWrapping(value: int) | Sets the text wrapping value. |
getTitle() → String | Gets or sets title of this table. |
setTitle(value: String) | Sets the title value. |
getDescription() → String | Gets or sets description of this table. |
setDescription(value: String) | Sets the description value. |
getDistanceLeft() → double | Gets or sets distance between table left and the surrounding text, in points. |
setDistanceLeft(value: double) | Sets the distance left value. |
getDistanceRight() → double | Gets or sets distance between table right and the surrounding text, in points. |
setDistanceRight(value: double) | Sets the distance right value. |
getDistanceTop() → double | Gets or sets distance between table top and the surrounding text, in points. |
setDistanceTop(value: double) | Sets the distance top value. |
getDistanceBottom() → double | Gets or sets distance between table bottom and the surrounding text, in points. |
setDistanceBottom(value: double) | Sets the distance bottom value. |
getRelativeHorizontalAlignment() → int | Gets or sets floating table relative horizontal alignment. |
setRelativeHorizontalAlignment(value: int) | Sets the relative horizontal alignment value. |
getRelativeVerticalAlignment() → int | Gets or sets floating table relative vertical alignment. |
setRelativeVerticalAlignment(value: int) | Sets the relative vertical alignment value. |
getHorizontalAnchor() → int | Gets the base object from which the horizontal positioning of floating table should be calculated. |
setHorizontalAnchor(value: int) | Sets the horizontal anchor value. |
getVerticalAnchor() → int | Gets the base object from which the vertical positioning of floating table should be calculated. |
setVerticalAnchor(value: int) | Sets the vertical anchor value. |
getAbsoluteHorizontalDistance() → double | Gets or sets absolute horizontal floating table position specified by the table properties, in points. |
setAbsoluteHorizontalDistance(value: double) | Sets the absolute horizontal distance value. |
getAbsoluteVerticalDistance() → double | Gets or sets absolute vertical floating table position specified by the table properties, in points. |
setAbsoluteVerticalDistance(value: double) | Sets the absolute vertical distance value. |
getAllowOverlap() → boolean | Gets 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. |