Documentation
¶
Overview ¶
Package table renders aligned, borderless tables for CLI output.
It wraps charmbracelet/lipgloss/table with sensible defaults: no borders, automatic terminal width detection, ANSI-aware column sizing, and cell normalization (tabs/newlines → spaces).
Index ¶
- func CellMaxWidth() int
- func CellWidth(value string) int
- func ColumnPaddingWidth() int
- func Format(headers []string, rows [][]string) string
- func OverrideViewportWidth(fn func() int) func()
- func TruncateCell(value string) string
- func TruncateCellToWidth(value string, max int) string
- func ViewportWidth() int
- type Builder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CellMaxWidth ¶
func CellMaxWidth() int
CellMaxWidth reports the default maximum width for table cells.
func ColumnPaddingWidth ¶
func ColumnPaddingWidth() int
ColumnPaddingWidth reports the padding between columns.
func OverrideViewportWidth ¶
func OverrideViewportWidth(fn func() int) func()
OverrideViewportWidth replaces the viewport width provider.
func TruncateCell ¶
TruncateCell limits cell width while preserving visible characters.
func TruncateCellToWidth ¶
TruncateCellToWidth limits cell width while preserving visible characters.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder collects rows and renders a formatted table.
func NewBuilder ¶
NewBuilder returns a builder with preallocated rows.