Table of Contents

Method CreateGrid

Namespace
Terminal.Gui.Views
Assembly
Terminal.Gui.dll

CreateGrid(IEnumerable<TableColumnData>, IEnumerable<TableRowData>)

Creates a grid table with explicit headers, spans, and Markdown block cells.

public static TableData CreateGrid(IEnumerable<TableColumnData> columns, IEnumerable<TableRowData> rows)

Parameters

columns IEnumerable<TableColumnData>

Logical column definitions. The collection is copied.

rows IEnumerable<TableRowData>

Logical rows, including rows occupied entirely by spans. The collection is copied.

Returns

TableData

A validated grid table. Unoccupied positions render as empty cells.

Examples

TableData data = TableData.CreateGrid ([new (), new ()],
    [new (false, [new (0, "A spanning cell", columnSpan: 2)])]);

Remarks

To render rich cells, assign the result to TableData. Existing string-array constructor cells continue to use inline source. See Markdown tables for sizing and clipboard rules.

Exceptions

ArgumentException

Cells overlap or extend outside the supplied grid.