table

package
v1.0.55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(body *Body, opts ...Option) string

Types

type Body

type Body struct {
	// contains filtered or unexported fields
}

func NewBody

func NewBody(rows ...*Row) *Body

func NewBodyFromStrings

func NewBodyFromStrings(rows ...[]string) *Body

func (*Body) AddCellsRow

func (b *Body) AddCellsRow(cells ...Cell) *Body

func (*Body) AddCellsRows

func (b *Body) AddCellsRows(rows ...[]Cell) *Body

func (*Body) AddRow

func (b *Body) AddRow(row *Row)

func (*Body) AddStringsRow

func (b *Body) AddStringsRow(cells ...string) *Body

func (*Body) AddStringsRows

func (b *Body) AddStringsRows(rows ...[]string) *Body

func (*Body) Clone

func (b *Body) Clone() *Body

func (*Body) Rows

func (b *Body) Rows() []*Row

type Cell

type Cell struct {
	// contains filtered or unexported fields
}

func NewCell

func NewCell(text string) Cell

func (Cell) SetPretty

func (c Cell) SetPretty(styled bool) Cell

func (Cell) SetStyle

func (c Cell) SetStyle(style lipgloss.Style) Cell

func (Cell) String

func (c Cell) String() string

func (Cell) Styled

func (c Cell) Styled() string

type Option

type Option = gn.Option[tableConfig]

func WithHeader

func WithHeader(header *Row) Option

func WithSize

func WithSize(width, height int) Option

type Row

type Row struct {
	// contains filtered or unexported fields
}

func NewRow

func NewRow(cells ...Cell) *Row

func NewRowFromStrings

func NewRowFromStrings(cells ...string) *Row

func (*Row) AddCell

func (r *Row) AddCell(cell Cell) *Row

func (*Row) AddCells

func (r *Row) AddCells(cells ...Cell) *Row

func (*Row) AddStringCell

func (r *Row) AddStringCell(text string) *Row

func (*Row) AddStringCells

func (r *Row) AddStringCells(cells ...string) *Row

func (*Row) Cells

func (r *Row) Cells() []Cell

func (*Row) Clone

func (r *Row) Clone() *Row

func (*Row) Index

func (r *Row) Index() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL