Core table, row, cell, and column data model.
Types
Cell = object text*: string alignment*: TextAlignment verticalAlignment*: VerticalAlignment padding*: CellPadding style*: TerminalStyle hasAlignment*, hasVerticalAlignment*, hasPadding*: bool columnSpan*, rowSpan*: int
- Text and optional layout/style overrides for one table cell.
Column = object width*: WidthConstraint alignment*: TextAlignment verticalAlignment*: VerticalAlignment padding*: CellPadding style*: TerminalStyle hasAlignment*, hasVerticalAlignment*, hasPadding*: bool widthPriority*: int
- Layout, width, and style settings for one column.
Panel = object cell*: Cell position*: PanelPosition
- One full-width cell rendered above or below the normal grid.
Row = object cells*: seq[Cell] alignment*: TextAlignment verticalAlignment*: VerticalAlignment padding*: CellPadding style*: TerminalStyle hasAlignment*, hasVerticalAlignment*, hasPadding*: bool
- An ordered collection of cells with optional shared overrides.
Table = object header*: Row hasHeader*: bool footer*: Row hasFooter*: bool title*: Cell hasTitle*: bool panels*: seq[Panel] rows*: seq[Row] columns*: seq[Column] theme*: TableTheme alignment*: TextAlignment verticalAlignment*: VerticalAlignment padding*: CellPadding margin*: TableMargin overflow*: OverflowMode truncationSuffix*: string style*: TerminalStyle borderStyle*: TerminalStyle shadow*: Shadow useColor*: bool
- A complete table model. Rendering never mutates it.
Procs
proc clearHeader(table: var Table) {....raises: [], tags: [], forbids: [].}
- Removes the header without changing column definitions.
proc clearTitle(table: var Table) {....raises: [], tags: [], forbids: [].}
- Removes the title.
proc columnCount(table: Table): int {....raises: [], tags: [], forbids: [].}
- Returns the table's fixed number of columns.
proc headerCell(table: var Table; columnIndex: int): var Cell {. ...raises: [ValueError], tags: [], forbids: [].}
proc initColumn(): Column {....raises: [], tags: [], forbids: [].}
- Creates a content-sized column with inherited layout settings.
proc setAlignment(value`gensym351: var Cell; alignment`gensym351: TextAlignment) {. ...raises: [], tags: [], forbids: [].}
- Sets an explicit horizontal alignment override.
proc setAlignment(value`gensym353: var Row; alignment`gensym353: TextAlignment) {. ...raises: [], tags: [], forbids: [].}
- Sets an explicit horizontal alignment override.
proc setAlignment(value`gensym355: var Column; alignment`gensym355: TextAlignment) {....raises: [], tags: [], forbids: [].}
- Sets an explicit horizontal alignment override.
proc setPadding(value`gensym351: var Cell; padding`gensym351: CellPadding) {. ...raises: [ValueError], tags: [], forbids: [].}
- Sets an explicit padding override.
proc setPadding(value`gensym353: var Row; padding`gensym353: CellPadding) {. ...raises: [ValueError], tags: [], forbids: [].}
- Sets an explicit padding override.
proc setPadding(value`gensym355: var Column; padding`gensym355: CellPadding) {. ...raises: [ValueError], tags: [], forbids: [].}
- Sets an explicit padding override.
proc setVerticalAlignment(value`gensym351: var Cell; alignment`gensym351: VerticalAlignment) {....raises: [], tags: [], forbids: [].}
- Sets an explicit vertical alignment override.
proc setVerticalAlignment(value`gensym353: var Row; alignment`gensym353: VerticalAlignment) {....raises: [], tags: [], forbids: [].}
- Sets an explicit vertical alignment override.
proc setVerticalAlignment(value`gensym355: var Column; alignment`gensym355: VerticalAlignment) {....raises: [], tags: [], forbids: [].}
- Sets an explicit vertical alignment override.
proc setWidthPriority(column: var Column; priority: int) {....raises: [], tags: [], forbids: [].}
- Sets responsive shrink priority. Lower values shrink first.
Exports
-
initTableMargin, OverflowMode, VerticalAlignment, initCellPadding, WidthKind, fixedWidth, contentWidth, initShadow, WidthConstraint, minimumWidth, percentageWidth, Shadow, PanelPosition, TableMargin, CellPadding, maximumWidth, markdownTheme, asciiTheme, modernTheme, borderlessTheme, psqlTheme, BorderSet, roundedTheme, TableTheme, customTheme