Versions in this module Expand all Collapse all v1 v1.1.1 Oct 28, 2026 Changes in this version type TableOption + func WithIndent(n int) TableOption v1.1.0 Apr 22, 2026 Changes in this version + type BorderEdge uint8 + const BorderEdgeAuto + const BorderEdgeHidden + const BorderEdgeNone + const BorderEdgeSolid type CellOption + func WithCellBorder(e BorderEdge) CellOption + func WithCellBorderBottom(e BorderEdge) CellOption + func WithCellBorderLeft(e BorderEdge) CellOption + func WithCellBorderRight(e BorderEdge) CellOption + func WithCellBorderTop(e BorderEdge) CellOption type RowOption + func WithRowBorder(e BorderEdge) RowOption + func WithRowBorderBottom(e BorderEdge) RowOption + func WithRowBorderTop(e BorderEdge) RowOption v1.0.0 Apr 22, 2026 Changes in this version + var ErrCrossSectionSpan = errors.New("row span crosses section boundary") + var ErrReaderAlreadyConsumed = errors.New("cell reader already consumed") + var ErrSpanConflict = errors.New("cell span conflicts with an occupied grid slot") + var ErrTargetTooNarrow = errors.New("target width too narrow for one glyph per column") + func DisplayWidth(s string) int + func Layout(t *Table, m *measureResult) *layoutResult + func Measure(t *Table) *measureResult + func MinUnbreakableWidth(s string) int + func NaturalLines(s string) [][]GraphemeRun + func StripANSI(s string) string + func Wrap(lines [][]GraphemeRun, width int, wrap, trim bool, maxHeight int, ...) []string + type Alignment uint8 + const AlignCenter + const AlignLeft + const AlignRight + func (a Alignment) String() string + type BorderSet struct + Horizontal rune + Joins [16]rune + Vertical rune + func ASCIILine() BorderSet + func DefaultSingleLine() BorderSet + func DoubleLine() BorderSet + func HeavyLine() BorderSet + func NoBorder() BorderSet + func RoundedLine() BorderSet + func SingleLine() BorderSet + type Cell struct + func NewCell(opts ...CellOption) *Cell + func (c *Cell) Align() Alignment + func (c *Cell) ColSpan() int + func (c *Cell) Content() string + func (c *Cell) GridCol() int + func (c *Cell) GridRow() int + func (c *Cell) ID() string + func (c *Cell) RowSpan() int + type CellOption func(*Cell) + func WithAlign(a Alignment) CellOption + func WithBackgroundColor(value string) CellOption + func WithBold() CellOption + func WithCellID(id string) CellOption + func WithCellStyle(css string) CellOption + func WithColSpan(n int) CellOption + func WithContent(s string) CellOption + func WithItalic() CellOption + func WithMaxLines(n int) CellOption + func WithMultiLine() CellOption + func WithReader(r io.Reader) CellOption + func WithRowSpan(n int) CellOption + func WithSingleLine() CellOption + func WithStrikethrough() CellOption + func WithTextColor(value string) CellOption + func WithTrim(enable bool) CellOption + func WithTrimPosition(pos TrimPosition) CellOption + func WithUnderline() CellOption + func WithVAlign(v VerticalAlignment) CellOption + func WithWrap(enable bool) CellOption + type Column struct + func (c *Column) Align() Alignment + func (c *Column) HasAlign() bool + func (c *Column) ID() string + func (c *Column) Index() int + func (c *Column) Max() int + func (c *Column) Min() int + func (c *Column) SetAlign(a Alignment) *Column + func (c *Column) SetID(id string) *Column + func (c *Column) SetMax(n int) *Column + func (c *Column) SetMaxPercent(p int) *Column + func (c *Column) SetMin(n int) *Column + func (c *Column) SetMinPercent(p int) *Column + func (c *Column) SetVAlign(v VerticalAlignment) *Column + func (c *Column) SetWeight(w float64) *Column + func (c *Column) SetWidth(n int) *Column + func (c *Column) SetWidthPercent(p int) *Column + func (c *Column) Style(css string) *Column + func (c *Column) Weight() float64 + func (c *Column) Width() int + type ContentSourceReplacedEvent struct + CellID string + FinalSource string + func (e ContentSourceReplacedEvent) String() string + type CrossSectionSpanEvent struct + CellID string + DeclaredSpan int + EffectiveSpan int + Section string + func (e CrossSectionSpanEvent) String() string + type DuplicateIDEvent struct + ID string + Kind string + func (e DuplicateIDEvent) String() string + type Element interface + type EmojiWidthMode uint8 + const EmojiWidthAuto + const EmojiWidthConservative + const EmojiWidthGrapheme + func (m EmojiWidthMode) String() string + type Footer struct + func (f *Footer) AddCell(opts ...CellOption) *Cell + func (f *Footer) AddCellWithError(opts ...CellOption) (*Cell, error) + func (f *Footer) AttachCell(c *Cell) *Cell + func (f *Footer) AttachCellWithError(c *Cell) (*Cell, error) + func (f *Footer) Cell(i int) *Cell + func (f *Footer) Cells() []*Cell + func (f *Footer) ID() string + type GraphemeRun struct + EscPrefix string + Text string + Width int + type Header struct + func (h *Header) AddCell(opts ...CellOption) *Cell + func (h *Header) AddCellWithError(opts ...CellOption) (*Cell, error) + func (h *Header) AttachCell(c *Cell) *Cell + func (h *Header) AttachCellWithError(c *Cell) (*Cell, error) + func (h *Header) Cell(i int) *Cell + func (h *Header) Cells() []*Cell + func (h *Header) ID() string + type OverwriteEvent struct + At [2]int + DroppedID string + NewColSpan int + NewRowSpan int + TruncatedID string + func (e OverwriteEvent) String() string + type Padding struct + Bottom int + Left int + Right int + Top int + func DefaultPadding() Padding + type ReaderErrorEvent struct + CellID string + Err error + func (e ReaderErrorEvent) String() string + type Row struct + func (r *Row) AddCell(opts ...CellOption) *Cell + func (r *Row) AddCellWithError(opts ...CellOption) (*Cell, error) + func (r *Row) AttachCell(c *Cell) *Cell + func (r *Row) AttachCellWithError(c *Cell) (*Cell, error) + func (r *Row) Cell(i int) *Cell + func (r *Row) Cells() []*Cell + func (r *Row) ID() string + type RowOption func(*rowBody) + func WithCell(c *Cell) RowOption + func WithRowID(id string) RowOption + func WithRowStyle(css string) RowOption + type SpanOverflowEvent struct + CellID string + Got int + Required int + func (e SpanOverflowEvent) String() string + type Style struct + type Table struct + func NewTable(opts ...TableOption) *Table + func (t *Table) AddFooter(opts ...RowOption) *Footer + func (t *Table) AddHeader(opts ...RowOption) *Header + func (t *Table) AddRow(opts ...RowOption) *Row + func (t *Table) CellAt(r, c int) *Cell + func (t *Table) Column(i int) *Column + func (t *Table) Columns() []*Column + func (t *Table) Footers() []*Footer + func (t *Table) GetElementByID(id string) Element + func (t *Table) Headers() []*Header + func (t *Table) ID() string + func (t *Table) InBounds(r, c int) bool + func (t *Table) LastRenderError() error + func (t *Table) NumColumns() int + func (t *Table) NumRows() int + func (t *Table) ResolvedTargetWidth() int + func (t *Table) Rows() []*Row + func (t *Table) String() string + func (t *Table) Warnings() []Warning + func (t *Table) WriteTo(w io.Writer) (int64, error) + type TableOption func(*Table) + func WithBorder(b BorderSet) TableOption + func WithEmojiWidth(mode EmojiWidthMode) TableOption + func WithMaxWidth(n int) TableOption + func WithMaxWidthPercent(p int) TableOption + func WithMinWidth(n int) TableOption + func WithMinWidthPercent(p int) TableOption + func WithSpanOverwrite(enable bool) TableOption + func WithTableID(id string) TableOption + func WithTablePadding(p Padding) TableOption + func WithTableStyle(css string) TableOption + func WithTargetWidth(w int) TableOption + func WithTargetWidthPercent(p int) TableOption + type TrimPosition uint8 + const TrimEnd + const TrimMiddle + const TrimStart + func (p TrimPosition) String() string + type VerticalAlignment uint8 + const VAlignBottom + const VAlignMiddle + const VAlignTop + func (v VerticalAlignment) String() string + type Warning interface + String func() string