Table
Overview
Table is a class in Aspose.PDF FOSS for .NET.
Inherits from: BaseParagraph.
Represents a table that can be added to a PDF page.
This class provides 12 methods for working with Table objects in .NET programs.
Available methods include: Build, BuildMultiPage, Clone, GetHeight, GetWidth, ImportArray, ImportDataTable, ImportDataView, SetColumnTextState, Table.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: Alignment, BackgroundColor, Border, BreakText, Broken, ColumnAdjustment, and 24 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
ColumnWidths | string? | Read/Write | Space-separated column widths (e.g. |
Border | BorderInfo? | Read/Write | Table border. |
DefaultCellBorder | BorderInfo? | Read/Write | Default cell border applied to all cells unless overridden. |
DefaultCellPadding | MarginInfo? | Read/Write | Default cell padding. |
DefaultCellTextState | TextState? | Read/Write | Default text state for cells. |
BackgroundColor | Color? | Read/Write | Table background color. |
Left | float | Read/Write | Left position of the table on the page. |
Top | float | Read/Write | Top position of the table on the page (distance from page top). |
Margin | MarginInfo | Read/Write | Table margin. |
RepeatingRowsCount | int | Read/Write | Number of rows to repeat at the top of each page when the table spans pages. |
RepeatingColumnsCount | int | Read/Write | Maximum columns count for the table. |
Broken | TableBroken | Read/Write | How the table breaks across pages. |
IsBroken | bool | Read/Write | Whether the table is allowed to break across pages. |
ColumnAdjustment | ColumnAdjustment | Read/Write | How columns are sized when the table is rendered (API parity). |
Rows | Rows | Read | The collection of rows in this table. |
DefaultColumnWidth | string? | Read/Write | Default column-width used when ColumnWidths is empty. |
CornerStyle | BorderCornerStyle | Read/Write | Corner-rounding style applied to the table’s border box. |
IsBordersIncluded | bool | Read/Write | When true, cell-border widths count against cell padding and row-height calculations. |
BreakText | TextFragment? | Read/Write | Optional indicator drawn at the page break when a row is split across pages. |
RepeatingRowsStyle | TextState? | Read/Write | Default text state for the rows repeated on continuation pages (see RepeatingRowsCount). |
Alignment | HorizontalAlignment | Read/Write | Gets or sets the alignment. |
HorizontalAlignment | HorizontalAlignment | Read/Write | Horizontal alignment applied to this paragraph. |
VerticalAlignment | VerticalAlignment | Read/Write | Vertical alignment applied to this paragraph. |
IsFirstParagraphInColumn | bool | Read/Write | Force the paragraph to start a new column. |
IsKeptWithNext | bool | Read/Write | Keep this paragraph on the same page as the next one. |
IsInNewPage | bool | Read/Write | Force the paragraph to start on a new page. |
IsInLineParagraph | bool | Read/Write | Inline paragraph flag (does not start a new line). |
HyperlinkText | string? | Read/Write | Legacy string-typed hyperlink target. |
Hyperlink | Hyperlink? | Read/Write | Typed hyperlink decoration applied to the paragraph. |
ZIndex | int | Read/Write | Z-order index used by the DOM renderer. |
Methods
| Signature | Description |
|---|---|
Table() | Calls Table on this Table instance. |
GetWidth() | Sum of column widths from ColumnWidths. |
GetHeight(parentPage: Page) | Approximate rendered height of the table on parentPage. |
SetColumnTextState(colNumber: int, textState: Aspose.Pdf.Text.TextState) | Apply textState to every cell in the given (1-based) column number. |
Clone() | Shallow clone of the table. |
ImportArray(importedArray: object?[], firstFilledRow: int, firstFilledColumn: int, isLeftColumnsFilled: bool) | Import a 2-D object array into the table. |
ImportDataTable(importedDataTable: System.Data.DataTable, isColumnNamesImported: bool, firstFilledRow: int, firstFilledColumn: int) | Import all rows of a DataTable. |
ImportDataTable(importedDataTable: System.Data.DataTable, isColumnNamesShown: bool, firstFilledRow: int, firstFilledColumn: byte, maxRows: int, maxColumns: int, isHtmlSupported: bool) | Import with explicit max-rows / max-columns and HTML support flag. |
ImportDataTable(importedDataTable: System.Data.DataTable, sourceRowList: int[], sourceColumnList: int[], firstFilledRow: int, firstFilledColumn: int, showColumnNamesAsFirstRow: bool, isHtmlSupported: bool) | Import a subset of rows / columns selected by index lists. |
ImportDataView(sourceDataView: System.Data.DataView, isColumnNamesImported: bool, firstFilledRow: int, firstFilledColumn: int, maxRows: int, maxColumns: int) | Import a DataView. |
BuildMultiPage(page: Page, startY: double, bottomMargin: double, topMargin: double) | Build the table across multiple pages. |
Build(page: Page) | Build the table content stream bytes for the given page. |