Source   Edit


Cell = object
  text*: string
  width*, row*, col*, ncols*, nrows*: int
  Source   Edit


proc alignTable(s: string; delim = '\t'; fill = ' '; sep = " "): string {.
    ...raises: [], tags: [].}
Formats a delim-delimited s representing a table; each cell is aligned to a width that's computed for each column; consecutive columns are delimited by sep, and alignment space is filled using fill. More customized formatting can be done by calling parseTableCells directly.   Source   Edit


iterator parseTableCells(s: string; delim = '\t'): Cell {....raises: [], tags: [].}
Iterates over all cells in a delim-delimited s, after a 1st pass that computes number of rows, columns, and width of each column.   Source   Edit