VDocs.NET
HomeAPI Reference
Back to DOM

DOM.Elements.TableElements.Table

Namespace: DOM.Elements.TableElements

Represents a table element within the document model. Aconsists of rows and cells, supports indexing, styling, captions, descriptions, zebra striping, and provides enumeration over both rows and cells.

22 members

Constructors

Table

2 overloads
Table()

Initializes a new instance of theclass with no rows or columns.

Table(int row, int column)

Initializes a newwith the specified number of rows and columns. Each cell is created as an instance ofand added to the appropriate row.

Parameters

row
The number of rows to create.
column
The number of columns to create within each row.

Properties

Caption

Gets or sets an optional caption displayed with the table, often used to label or title the content.

Description

Gets or sets an optional description that can be associated with the table, typically used for accessibility or metadata purposes.

Item

Gets or sets the table row at the specified row index.

Item

Gets or sets a specific table cell using row and column indices.

Rows

Gets all the table rows contained within this table.

Style

Gets or sets the style applied to this table, including borders, alignment, spacing, and visual appearance.

ZebraColor

Gets or sets zebra-striping color definitions for alternating row styling.

Methods

FromCsv

2 overloads
Table FromCsv(string filePath, bool hasHeaderRow, char delimiter, TableStyle style)

Creates afrom a CSV file located at the specified path.

This method performs basic CSV parsing using. For complex CSV formats (escaped delimiters, multi-line fields), consider using a dedicated CSV parser before creating the table.

Parameters

filePath
The full path to the CSV file.
hasHeaderRow
Indicates whether the first row represents column headers.
delimiter
The character used to separate values in the CSV file. Default is comma (,).
style
An optionalto apply to the resulting table.

Returns

Table

Apopulated with data from the CSV file.

Table FromCsv(Stream stream, bool hasHeaderRow, char delimiter, TableStyle style)

Creates afrom CSV data read from a stream.

The stream is read using aand disposed after use. This implementation uses simple delimiter-based splitting and may not support advanced CSV scenarios such as escaped quotes or embedded delimiters.

Parameters

stream
The inputcontaining CSV data.
hasHeaderRow
Indicates whether the first row represents column headers.
delimiter
The character used to separate values in the CSV data. Default is comma (,).
style
An optionalto apply to the resulting table.

Returns

Table

Apopulated with the parsed CSV data.

FromDataTable

Table FromDataTable(DataTable dataTable, bool includeHeaders, TableStyle style)

Creates ainstance from a.

All cell values are converted to strings using. Null values are converted to empty strings.

Parameters

dataTable
The sourcecontaining rows and columns to populate the table.
includeHeaders
If, a header row will be created using the column names from thecollection.
style
An optionalto apply to the created table.

Returns

Table

A populatedcontaining the data from the specified.

Exceptions

  • System.ArgumentNullException: Thrown whenis.

FromEnumerable``1

Table FromEnumerable``1(IEnumerable<`> data, bool includeHeaders, TableStyle style)

Creates afrom an enumerable data source.

- For primitive or simple types (e.g.,,), a single-column table is generated. - For complex types, public instance properties are used as columns. - Property values are converted to strings using.

Parameters

data
The collection of objects used to populate the table.
includeHeaders
If, a header row will be generated. For complex types, property names are used as column headers.
style
An optionalto apply to the resulting table.

Returns

Table

Arepresenting the data in tabular form.

Exceptions

  • System.ArgumentNullException: Thrown whenis.

GetCell

GetCell(int, int)

Retrieves the cell located at the specified row and column indices.

GetEnumerator

ITableCell GetEnumerator

Returns an enumerator that iterates through all table cells in row-major order.

Returns

ITableCell

An enumerator of.

GetRow

GetRow(int)

Retrieves the row at the specified index.

MergeCells

ITable MergeCells(int startRow, int startColumn, int endRow, int endColumn)

Merges a group of cells defined by the start and end coordinates. This feature is not yet implemented.

Parameters

startRow
The starting row index.
startColumn
The starting column index.
endRow
The ending row index.
endColumn
The ending column index.

Returns

ITable

The currentinstance.

Exceptions

  • System.NotImplementedException: Always thrown until implemented.

RemoveRow

2 overloads
ITable RemoveRow(ITableRow tableRow)

Removes the specified row from the table.

Parameters

tableRow
The row to remove.

Returns

ITable

The currentinstance.

ITable RemoveRow(int index)

Removes the row at the specified index, if it exists.

Parameters

index
The zero-based row index.

Returns

ITable

The currentinstance.

SetCellValue

SetCellValue(int, int, IElement)

Replaces the content of a cell at the specified coordinates.

System#Collections#Generic#IEnumerable{DOM#Abstracts#Interfaces#Elements#TableElements#ITableRow}#GetEnumerator

System#Collections#Generic#IEnumerable{DOM#Abstracts#Interfaces#Elements#TableElements#ITableRow}#GetEnumerator

Returns an enumerator that iterates through the table rows.

System#Collections#IEnumerable#GetEnumerator

System#Collections#IEnumerable#GetEnumerator

Returns an enumerator that iterates through the table cells.