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

NameTypeAccessDescription
ColumnWidthsstring?Read/WriteSpace-separated column widths (e.g.
BorderBorderInfo?Read/WriteTable border.
DefaultCellBorderBorderInfo?Read/WriteDefault cell border applied to all cells unless overridden.
DefaultCellPaddingMarginInfo?Read/WriteDefault cell padding.
DefaultCellTextStateTextState?Read/WriteDefault text state for cells.
BackgroundColorColor?Read/WriteTable background color.
LeftfloatRead/WriteLeft position of the table on the page.
TopfloatRead/WriteTop position of the table on the page (distance from page top).
MarginMarginInfoRead/WriteTable margin.
RepeatingRowsCountintRead/WriteNumber of rows to repeat at the top of each page when the table spans pages.
RepeatingColumnsCountintRead/WriteMaximum columns count for the table.
BrokenTableBrokenRead/WriteHow the table breaks across pages.
IsBrokenboolRead/WriteWhether the table is allowed to break across pages.
ColumnAdjustmentColumnAdjustmentRead/WriteHow columns are sized when the table is rendered (API parity).
RowsRowsReadThe collection of rows in this table.
DefaultColumnWidthstring?Read/WriteDefault column-width used when ColumnWidths is empty.
CornerStyleBorderCornerStyleRead/WriteCorner-rounding style applied to the table’s border box.
IsBordersIncludedboolRead/WriteWhen true, cell-border widths count against cell padding and row-height calculations.
BreakTextTextFragment?Read/WriteOptional indicator drawn at the page break when a row is split across pages.
RepeatingRowsStyleTextState?Read/WriteDefault text state for the rows repeated on continuation pages (see RepeatingRowsCount).
AlignmentHorizontalAlignmentRead/WriteGets or sets the alignment.
HorizontalAlignmentHorizontalAlignmentRead/WriteHorizontal alignment applied to this paragraph.
VerticalAlignmentVerticalAlignmentRead/WriteVertical alignment applied to this paragraph.
IsFirstParagraphInColumnboolRead/WriteForce the paragraph to start a new column.
IsKeptWithNextboolRead/WriteKeep this paragraph on the same page as the next one.
IsInNewPageboolRead/WriteForce the paragraph to start on a new page.
IsInLineParagraphboolRead/WriteInline paragraph flag (does not start a new line).
HyperlinkTextstring?Read/WriteLegacy string-typed hyperlink target.
HyperlinkHyperlink?Read/WriteTyped hyperlink decoration applied to the paragraph.
ZIndexintRead/WriteZ-order index used by the DOM renderer.

Methods

SignatureDescription
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.

See Also