Documentation
¶
Overview ¶
Package table renders tables for termtable: a grid family (unicode, rounded, ascii, markdown) and borderless padded columns. All of it is written for this module, with no third-party table code and no attribution requirements. It is internal, so only the termtable style api is public.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Bordered draws a full unicode box. Bordered = GridConfig{Top: true, Bottom: true, RowLines: true, /* contains filtered or unexported fields */} // Rounded is Bordered with rounded corners. Rounded = GridConfig{Top: true, Bottom: true, RowLines: true, /* contains filtered or unexported fields */} // ASCII is Bordered with plain ascii pieces. ASCII = GridConfig{Top: true, Bottom: true, RowLines: true, /* contains filtered or unexported fields */} // Markdown draws a pipe table with a header rule, for docs. Markdown = GridConfig{HeaderLeft: true, /* contains filtered or unexported fields */} )
Grid presets.
Functions ¶
func Grid ¶
Grid writes header and rows as a grid table. Cells wrap to their contents unless the table outgrows the writer's width: os.Stdout measures the terminal, anything else assumes eighty columns, and oversized cells then wrap at word boundaries with hyphens.
Types ¶
type GridConfig ¶
type GridConfig struct {
Top bool // draw the outer top border
Bottom bool // draw the outer bottom border
RowLines bool // draw rules between data rows
HeaderLeft bool // left-align headers instead of centering
// contains filtered or unexported fields
}
GridConfig selects a grid look.