Columns
IColumns lays out children horizontally. Children share the available width; tall children wrap their lines vertically as needed.
When to use
- Side-by-side widgets without column-width control - just split the row.
- Building summary dashboards.
For column-width control (auto / fixed / star) and row-by-row data, use Grid. For a bordered table with headers, use Table.
Basic usage
pascal
var
cs : IColumns;
begin
cs := Widgets.Columns;
cs.Add(Widgets.Markup('[aqua]left column[/]'));
cs.Add(Widgets.Markup('[yellow]middle column[/]'));
cs.Add(Widgets.Markup('[lime]right column[/]'));
AnsiConsole.Write(cs);
end;1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Configuration
| Method | Purpose |
|---|---|
Add(child : IRenderable) : IColumns | Append a column. Returns Self for chaining. |
pascal
AnsiConsole.Write(
Widgets.Columns
.Add(Widgets.Panel(Widgets.Markup('[red]left[/]')))
.Add(Widgets.Panel(Widgets.Markup('[green]middle[/]')))
.Add(Widgets.Panel(Widgets.Markup('[blue]right[/]'))));1
2
3
4
5
2
3
4
5
API reference
Widgets.Columns— empty column stack.IColumns— interface.