Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CellStyle ¶ added in v0.1.2
type CellStyle struct {
// Align defines the alignment of the text.
Align text.Align
// WrapText defines if the text should be wrapped.
WrapText *bool
// TextAttrs defines the text attributes.
TextAttrs text.Colors
// CellAttrs defines the cell attributes.
CellAttrs text.Colors
}
CellStyle is the style of a cell in the table
type Table ¶
type Table interface {
AddHeader(header ...string)
AddRow(vals ...any)
SetStyle(style *TableStyle)
SetHeaderStyle(style *CellStyle)
SetRowStyle(row int, style *CellStyle)
SetColStyle(col int, style *CellStyle)
Render() string
}
func NewTableWithStyle ¶ added in v0.1.2
func NewTableWithStyle(style *TableStyle) Table
type TableStyle ¶ added in v0.1.2
type TableStyle struct {
// DefaultWidth defines the default width of the table.
DefaultWidth int
// FitToTerminal defines if the table should fit to the terminal width.
FitToTerminal bool
// WrapText defines if the text should be wrapped.
WrapText bool
// HideEmpty defines if empty rows should be hidden.
HideEmpty bool
// OuterPadding defines the padding around the table.
OuterPadding int
// InnerPadding defines the padding between the cells.
InnerPadding int
}
Click to show internal directories.
Click to hide internal directories.