DOM.Elements.TableElements.Table
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 overloadsTable()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
Gets or sets an optional caption displayed with the table, often used to label or title the content.
Gets or sets an optional description that can be associated with the table, typically used for accessibility or metadata purposes.
Gets or sets the table row at the specified row index.
Gets or sets a specific table cell using row and column indices.
Gets all the table rows contained within this table.
Gets or sets the style applied to this table, including borders, alignment, spacing, and visual appearance.
Gets or sets zebra-striping color definitions for alternating row styling.
Methods
FromCsv
2 overloadsTable 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.
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.
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.
Exceptions
- System.ArgumentNullException: Thrown whenis.
GetCell
GetCell(int, int)Retrieves the cell located at the specified row and column indices.
GetEnumerator
ITableCell GetEnumeratorReturns 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 overloadsITable 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}#GetEnumeratorReturns an enumerator that iterates through the table rows.
System#Collections#IEnumerable#GetEnumerator
System#Collections#IEnumerable#GetEnumeratorReturns an enumerator that iterates through the table cells.