Incremental construction for data whose shape is known at runtime.
Types
TableBuilder = object headers*: seq[string] rows*: seq[seq[string]] currentRow*: seq[string]
- Accumulates rows before validating and producing a Table.
Procs
proc addCell(builder: var TableBuilder; value: string) {....raises: [], tags: [], forbids: [].}
- Appends one cell to the row currently being assembled.
proc addRow(builder: var TableBuilder; values: varargs[string, `$`]) {. ...raises: [ValueError], tags: [], forbids: [].}
- Appends one complete dynamic row.
proc build(builder: TableBuilder): Table {....raises: [ValueError], tags: [], forbids: [].}
- Validates the accumulated shape and returns an independent table.
proc finishRow(builder: var TableBuilder) {....raises: [ValueError], tags: [], forbids: [].}
- Finishes the current row. Empty rows are rejected.
proc initTableBuilder(headers: openArray[string] = []): TableBuilder {. ...raises: [], tags: [], forbids: [].}
- Starts a dynamic table builder, optionally with a header.
Exports
-
addRow, roundedTheme, setFooter, cell, initTableMargin, addRow, initTable, OverflowMode, initCellPadding, row, setSpan, cell, initTable, setAlignment, setTitle, psqlTheme, contentWidth, setVerticalAlignment, clearFooter, markdownTheme, TableTheme, headerCell, Column, Table, columnCount, PanelPosition, CellPadding, maximumWidth, addPanel, Panel, panel, setVerticalAlignment, fixedWidth, setHeader, setPadding, Cell, VerticalAlignment, column, WidthKind, clearTitle, percentageWidth, customTheme, row, initRow, initColumn, setWidthPriority, Shadow, initCell, initShadow, setVerticalAlignment, footerCell, setAlignment, modernTheme, WidthConstraint, Row, minimumWidth, setAlignment, setPadding, TableMargin, column, borderlessTheme, setPadding, asciiTheme, clearHeader, BorderSet, clearSpan