Documentation
¶
Overview ¶
Package tablewriter provides a basic ASCII table writer with customization options for: headers, label columns, cell alignment, handling overly-wide cells (truncate vs wrap), and auto-merging repeat values in the same column.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetContentEdge ¶
func SetContentEdge(symbol string)
SetContentEdge sets the edge symbol in content rows to `symbol` (default: "|")
func SetDividingEdge ¶
func SetDividingEdge(symbol string)
SetDividingEdge sets the edge symbol in dividing rows to `symbol` (default: "+")
func SetDividingFiller ¶
func SetDividingFiller(symbol string)
SetDividingFiller sets the symbol that creates space between dividing edges to `symbol` (default: "-")
func SetDividingLabelEdge ¶
func SetDividingLabelEdge(symbol string)
SetDividingLabelEdge sets the edge symbol that demarcates the end of the label levels in dividing rows to `symbol` (default: "++")
func SetLabelEdge ¶
func SetLabelEdge(symbol string)
SetLabelEdge sets the edge symbol that demarcates the end of the label levels in content rows to `symbol` (default: "||")
Types ¶
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
A Table can be rendered into a stringified representation of content rows and dividing rows with the results written into an io.Writer.
func (*Table) AppendHeaderRow ¶
AppendHeaderRow appends a header row to the table.
func (*Table) AppendRows ¶
AppendRows appends one or more non-header rows to the table.
func (*Table) MergeRepeats ¶ added in v0.1.2
func (tbl *Table) MergeRepeats()
MergeRepeats merges all repeated values in a column together.
func (*Table) Render ¶
Render creates a stringified representation of content rows and dividing rows and writes the results into the table's io.Writer.
func (*Table) TruncateWideCells ¶ added in v0.1.2
func (tbl *Table) TruncateWideCells()
TruncateWideCells handles overly wide cells by truncating them (default: wrap cell remainder onto new one or more new lines).