Skip to content

Table borders reference

TTableBorderKind enumerates the glyph sets used by Table. Each has a unicode form (where applicable) and an ASCII fallback; non-unicode terminals automatically use the fallback.

Available kinds

KindDescription
NoneWhitespace - columns sit in plain text.
Ascii+, -, |. Always ASCII.
Ascii2ASCII with cell verticals on header sides.
AsciiDoubleHeadASCII with = in the header separator.
Square (default)─ │ ┌ etc.
RoundedLike Square but with rounded corners.
Heavy━ ┃ ┏ ...
HeavyEdgeHeavy outer edges + light inner separators.
HeavyHeadHeavy top + heavy header separator, light elsewhere.
Double═ ║ ╔ ...
DoubleEdgeDouble outer edges + light inner separators.
MinimalOnly the cell vertical and the header separator.
MinimalHeavyHeadMinimal with a heavy header separator.
MinimalDoubleHeadMinimal with a double header separator.
SimpleOnly the header separator dashes; no verticals.
SimpleHeavySimple but with heavy header separator.
HorizontalDashes for every horizontal line, no verticals.
MinimalistHeader underline + space cell separator only.
MarkdownPipes + dashes, GitHub-compatible.

Markdown is special - the resulting output is valid GitHub-flavoured markdown that pastes cleanly into PRs and issues:

| Name  | Score |
|-------|-------|
| Alice |   128 |
| Bob   |    96 |

Usage

pascal
table := Widgets.Table.WithBorder(TTableBorderKind.Rounded);

Get an ITableBorder instance directly:

pascal
border := Widgets.TableBorder(TTableBorderKind.Heavy);

Glyph parts

TTableBorderPart:

TopLeft    Top    TopMid    TopRight
CellLeft           CellMid           CellRight
HeadLeft   Head   HeadMid   HeadRight
BottomLeft Bottom BottomMid BottomRight

Custom borders implement ITableBorder and return a Char for every TTableBorderPart value plus the kind.

See also

Released under the MIT License.