table

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commit

func Commit(s string) string

func CurrentVersion

func CurrentVersion(s string) string

CurrentVersion styles a current version string for display.

func Date

func Date(s string) string

func Scheme

func Scheme(s string) string

Types

type Align

type Align int

Align represents text alignment.

const (
	AlignLeft Align = iota
	AlignRight
	AlignCenter
)

type Column

type Column struct {
	Header string
	Width  int
	Align  Align
}

Column represents a table column.

type Row

type Row struct {
	Cells []string
}

Row represents a table row with styled cells.

type Table

type Table struct {
	Columns []Column
	Rows    []Row
	Border  bool
}

Table represents a formatted table.

func New

func New(columns []Column) *Table

New creates a new table.

func (*Table) AddRow

func (t *Table) AddRow(cells ...string)

AddRow adds a row to the table.

func (*Table) Render

func (t *Table) Render() string

Render returns the formatted table as a string.

Jump to

Keyboard shortcuts

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