tablecli

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: BSD-3-Clause Imports: 9 Imported by: 16

README

CLI library for rendering responsive tables

This project is a library to render CLI tables. It was extracted from the tsuru project.

Features

  • Nice word wrap on largest column to fit in the terminal window;
  • Easy to use;
  • ….

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TableConfig = struct {
	BreakOnAny   bool
	ForceWrap    bool
	UseTabWriter bool
	MaxTTYWidth  int

	TabWriterTruncate bool

	UseUTF8Borders  bool
	BorderColorFunc func(string) string
}{
	BreakOnAny:   false,
	ForceWrap:    false,
	UseTabWriter: false,
	MaxTTYWidth:  0,

	TabWriterTruncate: false,

	UseUTF8Borders:  false,
	BorderColorFunc: nil,
}

Functions

This section is empty.

Types

type Row

type Row []string

type Table

type Table struct {
	Headers       Row
	LineSeparator bool

	TableWriterTruncate   bool
	TableWriterPadding    int
	TableWriterExpandRows bool
	// contains filtered or unexported fields
}

func NewTable

func NewTable() *Table

func (*Table) AddRow

func (t *Table) AddRow(row Row)

func (*Table) Bytes

func (t *Table) Bytes() []byte

func (*Table) Reverse

func (t *Table) Reverse()

func (*Table) Rows

func (t *Table) Rows() int

func (*Table) Sort

func (t *Table) Sort()

Sort sorts the rows in the table using the first column as key.

func (*Table) SortByColumn

func (t *Table) SortByColumn(columns ...int)

func (*Table) String

func (t *Table) String() string

Jump to

Keyboard shortcuts

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