table

package module
v0.0.0-...-1be6f01 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTML

type HTML struct {
	DisableHeader bool
}

func (HTML) Print

func (html HTML) Print(w io.Writer, table *Table) error

type Markdown

type Markdown struct {
	DisableHeader     bool
	DisableHeaderLine bool
}

func (Markdown) Print

func (md Markdown) Print(w io.Writer, table *Table) error

type Row

type Row []any

type Rows

type Rows []Row

type Table

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

func (*Table) AddRow

func (table *Table) AddRow(row Row) error

func (*Table) Columns

func (table *Table) Columns() ([]string, error)

func (*Table) MaxColumnWidth

func (table *Table) MaxColumnWidth() (int, error)

MaxColumnWidth returns the size of the widest column.

func (*Table) QuickRow

func (table *Table) QuickRow(x ...any) error

func (*Table) Rows

func (table *Table) Rows() (Rows, error)

func (*Table) SetColumns

func (table *Table) SetColumns(s ...string) error

SetColumns sets the names of the columns. Once set, the columns cannot be changed. Once set, rows will be constrained to the number of columns.

Jump to

Keyboard shortcuts

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