table

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MPL-2.0, MIT Imports: 6 Imported by: 0

Documentation

Overview

table outputs data in a table format. The package is heavily inspired by github.com/gosuri/uitable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

type Table struct {
	// LineLength is the maximum allowed length of a line in the Table
	LineLength uint

	// Wrap when set to true wraps the contents of the columns when the length exceeds the MaxColWidth
	Wrap bool

	// SeparatorSpaces is the number of spaces between columns
	SeparatorSpaces uint

	// HeaderFormatter is a function that formats the header of the table
	HeaderFormatter func(input string) string

	// FirstColumnFormatter is a function that formats the first column of the table
	FirstColumnFormatter func(input string) string
	// contains filtered or unexported fields
}

Table represents a decorator that renders the data in formatted in a table

func (*Table) AddRow

func (t *Table) AddRow(data ...interface{}) *Table

AddRow adds a new row to the table

func (*Table) String

func (t *Table) String() string

String returns the string value of table

Jump to

Keyboard shortcuts

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