Documentation ¶
Index ¶
- Variables
- func CellPropertyExtractDimensions(cell *tabular.Cell) dimensions
- func CellPropertyExtractLinesWidths(cell *tabular.Cell) []decoration.WidthString
- func Render(t tabular.Table) (string, error)
- func RenderTo(t tabular.Table, w io.Writer) error
- type TextTable
- func (t *TextTable) Render() (string, error)
- func (t *TextTable) RenderTo(w io.Writer) error
- func (t *TextTable) RowToLinesOfWidthStrings(cells []tabular.Cell, columnCount int) [][]decoration.WidthString
- func (t *TextTable) SetDecoration(decor decoration.Decoration) *TextTable
- func (t *TextTable) SetDecorationNamed(n string) (*TextTable, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNotCellProperties = errors.New("texttable: dimensions-set: not given a cell")
Functions ¶
func CellPropertyExtractLinesWidths ¶
func CellPropertyExtractLinesWidths(cell *tabular.Cell) []decoration.WidthString
Types ¶
type TextTable ¶
A TextTable wraps a tabular.Table to act as the render control for tabular output to a fixed-cell grid system such as a terminal emulator (in the Unix TTY model).
func (*TextTable) Render ¶
Render returns a string representing the fully rendered table, or an error.
func (*TextTable) RenderTo ¶
RenderTo writes the TextTable to the provided writer, stopping if it encounters an error.
func (*TextTable) RowToLinesOfWidthStrings ¶
func (t *TextTable) RowToLinesOfWidthStrings( cells []tabular.Cell, columnCount int, ) [][]decoration.WidthString
func (*TextTable) SetDecoration ¶
func (t *TextTable) SetDecoration(decor decoration.Decoration) *TextTable
SetDecoration sets a Decoration type for rendering a table. The caller must provide the decoration object.
func (*TextTable) SetDecorationNamed ¶
SetDecorationNamed selects a decoration by name, from the decoration package. It returns an error if the name is not known. If the name is not known, this is still registered in the TextTable, so that later attempts to render it will fail, instead of succeeding with unexpected output.
Directories ¶
Path | Synopsis |
---|---|
The decoration package provides controls for how text tables are decorated for rendering.
|
The decoration package provides controls for how text tables are decorated for rendering. |