table

package
v1.6.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable[T any](data []T, opts ...Option[T]) string

Types

type Column

type Column[T any] struct {
	Title string
}

type Option

type Option[T any] func(*TableConfig[T])

func WithColumns

func WithColumns[T any](cols []Column[T]) Option[T]

func WithPrefix

func WithPrefix[T any](prefix string) Option[T]

func WithRowMapper

func WithRowMapper[T any](mapper RowMapper[T]) Option[T]

func WithShowHeader

func WithShowHeader[T any](show bool) Option[T]

func WithStyle

func WithStyle[T any](style lipgloss.Style) Option[T]

func WithSuffix

func WithSuffix[T any](suffix string) Option[T]

type RowMapper

type RowMapper[T any] func(T) []string

type TableConfig

type TableConfig[T any] struct {
	common.CommonConfig

	Columns    []Column[T]
	Mapper     RowMapper[T]
	ShowHeader bool
	Style      lipgloss.Style
}

Jump to

Keyboard shortcuts

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