Table

A renderable table.

A renderable table.

Constructors

public Table()

Initializes a new instance of the Table class.

Properties

Border : TableBorder

Gets or sets the border.

Caption : TableTitle

Gets or sets the table footnote.

Columns : IReadOnlyList<TableColumn>

Gets the table columns.

Expand : bool

Gets or sets a value indicating whether or not the table should fit the available space. If false, the table width will be auto calculated. Defaults to false.

Rows : TableRowCollection

Gets the table rows.

ShowFooters : bool

Gets or sets a value indicating whether or not table footers should be shown.

ShowHeaders : bool

Gets or sets a value indicating whether or not table headers should be shown.

ShowRowSeparators : bool

Gets or sets a value indicating whether or not row separators should be shown.

Title : TableTitle

Gets or sets the table title.

UseSafeBorder : bool

Gets or sets a value indicating whether or not to use a "safe" border on legacy consoles that might not be able to render non-ASCII characters.

Width : int?

Gets or sets the width of the table.

Methods

public Table AddColumn(TableColumn column)

Adds a column to the table.

Parameters:

column (TableColumn)
The column to add.

Returns:

The same instance so that multiple calls can be chained.

Extension Methods

Table AddColumn(this Table table, string column, Action<TableColumn> configure)

Adds a column to the table.

Returns:

The same instance so that multiple calls can be chained.

Table AddColumns(this Table table, string[] columns)

Adds multiple columns to the table.

Returns:

The same instance so that multiple calls can be chained.

Table AddColumns(this Table table, TableColumn[] columns)

Adds multiple columns to the table.

Returns:

The same instance so that multiple calls can be chained.

Table AddEmptyRow(this Table table)

Adds an empty row to the table.

Returns:

The same instance so that multiple calls can be chained.

Table AddRow(this Table table, string[] columns)

Adds a row to the table.

Returns:

The same instance so that multiple calls can be chained.

Table AddRow(this Table table, IRenderable[] columns)

Adds a row to the table.

Returns:

The same instance so that multiple calls can be chained.

Table AddRow(this Table table, IEnumerable<IRenderable> columns)

Adds a row to the table.

Returns:

The same instance so that multiple calls can be chained.

Table HideFooters(this Table table)

Hides table footers.

Returns:

The same instance so that multiple calls can be chained.

Table HideHeaders(this Table table)

Hides table headers.

Returns:

The same instance so that multiple calls can be chained.

Table HideRowSeparators(this Table table)

Hides row separators.

Returns:

The same instance so that multiple calls can be chained.

Table InsertRow(this Table table, int index, string[] columns)

Inserts a row in the table at the specified index.

Returns:

The same instance so that multiple calls can be chained.

Table InsertRow(this Table table, int index, IRenderable[] columns)

Inserts a row in the table at the specified index.

Returns:

The same instance so that multiple calls can be chained.

Table InsertRow(this Table table, int index, IEnumerable<IRenderable> columns)

Inserts a row in the table at the specified index.

Returns:

The same instance so that multiple calls can be chained.

Table RemoveRow(this Table table, int index)

Removes a row from the table with the specified index.

Returns:

The same instance so that multiple calls can be chained.

Table ShowFooters(this Table table)

Shows table footers.

Returns:

The same instance so that multiple calls can be chained.

Table ShowHeaders(this Table table)

Shows table headers.

Returns:

The same instance so that multiple calls can be chained.

Table ShowRowSeparators(this Table table)

Shows row separators.

Returns:

The same instance so that multiple calls can be chained.

Table UpdateCell(this Table table, int rowIndex, int columnIndex, string cellData)

Updates a tables cell.

Returns:

The same instance so that multiple calls can be chained.

Table UpdateCell(this Table table, int rowIndex, int columnIndex, IRenderable cellData)

Updates a tables cell.

Returns:

The same instance so that multiple calls can be chained.

Table Width(this Table table, int? width)

Sets the table width.

Returns:

The same instance so that multiple calls can be chained.