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 declares 14 methods for Table objects in .NET programs. Available methods include: BaseParagraph, Build, BuildMultiPage, Clone, GetHeight, GetWidth, ImportArray, ImportDataTable, ImportDataView, SetColumnTextState, Table. Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: Alignment, BackgroundColor, Border, BoxWidth, BreakText, Broken, and 40 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 compatibility).
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 how the table is placed across the page’s content width: Center or Right offsets a table narrower than that width; the default Left keeps it at the left margin.
IsBordersCollapsedboolRead/WriteAdjacent cells SHARE one stroke on the boundary between them, the way a collapsed HTML table draws: the boundary carries a single rule centred on it, half of it lying in each of the two cells.
CellPictureBoxesAreExactboolRead/WriteWhether a picture in a cell takes EXACTLY its box – its drawn height plus its own top and bottom margins, seated its left margin in, stacked with the cell’s lines at their own heights – instead of the whole lines of the row’s pitch it reserves by default (a 26.67 pt picture then costs three 12 pt lines).
SizesColumnsToContentboolRead/WriteSizes the columns from what they HOLD – an automatic table layout.
StretchesToBandboolRead/WriteStretches a content-sized grid (SizesColumnsToContent) across the whole band.
FixedLayoutboolRead/WriteLays a content-sized grid (SizesColumnsToContent) by its DECLARATIONS alone once it has a width to fill – a fixed table layout, the CSS table-layout: fixed model – and leaves it to the content-sized rules until then.
BoxWidthdoubleRead/WriteThe width of the grid’s own box when the caller declared one, in points: the grid is laid in that box instead of the band it stands in, and fills it the way StretchesToBand fills the band.
RepeatingFooterRowsCountintRead/WriteNumber of rows at the END of the table that form its FOOTER band.
RepeatingFooterSkipsLastPageboolRead/WriteMakes the footer band a CARRIED-FORWARD band: it closes every page the table runs onto except the one the table ENDS on, and that last page keeps the room the band would have taken.
RepeatingRowsSkipFirstPageboolRead/WriteMakes the repeating rows a CONTINUED-FROM band: the table opens with its body and RepeatingRowsCount rows stand only at the top of the pages it runs ONTO, so the first page gains the room the band would have taken.
CornerRadiiCornerRadii?Read/WriteRounds the grid’s corners (see CornerRadii).
RowsCloseUnderTheirGlyphsboolRead/WriteIn a collapsed grid (IsBordersCollapsed), a row the page cannot hold whole stays on it when its lines fit down to the glyphs of its last line – the half leading a declared line box keeps under them left out – with its bottom padding and the grid’s closing rule under them; its box then closes at the page’s bottom and what of it would have fallen past is cut.
RulesInsideColumnWidthboolRead/WriteA column’s declared width is its cells’ WHOLE box, rules included: a cell’s rules stand inside the width its column declares, and its text box is what they and the padding leave – the CSS separated-border model, where a 100 pt column with 0.5 pt rules is 100 wide, its rules on 0..0.5 and 99.5..100 and its text 2.5 in.
HorizontalCellSpacingdoubleRead/WriteThe gap between neighbouring cell boxes across the grid, and between the outermost boxes and the grid’s edge – its own border, when it has one – in points: CSS border-spacing, HTML cellspacing.
VerticalCellSpacingdoubleRead/WriteThe gap between one row’s cell boxes and the next’s, and between the first and last rows and the grid’s edge, in points – the vertical half of CSS border-spacing.
SpanHeightFallsOnLastRowboolRead/WritePuts a row-spanning cell’s SURPLUS height on the last row it covers.
SpanBlockSplitsAtPageBreakboolRead/WriteLets a row-spanning cell be CUT by a page break instead of moving whole to the next page.
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()Creates an empty table with no rows or columns.
GetWidth()Sum of column widths from ColumnWidths.
GetHeight()Approximate rendered height of the table, independent of any hosting page.
GetHeight(parentPage: Page?)Rendered height of the table on parentPage (or on a default content band when none is given).
SetColumnTextState(colNumber: int, textState: Aspose.Pdf.Text.TextState)Apply textState to every cell in the given (0-based) column number.
Clone()Shallow clone of the table.
Build(page: Page)Build the table content stream bytes for the given page.
BuildMultiPage(page: Page, startY: double, bottomMargin: double, topMargin: double, measureOnly: bool, contentFlow: bool)Build the table across multiple pages.
ImportArray(importedArray: object?[], firstFilledRow: int, firstFilledColumn: int, isLeftColumnsFilled: bool)Import a one-dimensional object array into the table, wrapping the values into rows by the table’s column count.
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.
BaseParagraph()Creates a paragraph with default alignment, an empty margin and no hyperlink.

See Also

 English