table

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MPL-2.0, MIT Imports: 6 Imported by: 0

Documentation

Overview

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

Package 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 MarkdownTable

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

MarkdownTable represents a decorator that renders the data in formatted in a table.

func (*MarkdownTable) AddRow

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

AddRow adds a new row to the table.

func (*MarkdownTable) String

func (t *MarkdownTable) String() string

String returns the string value of table.

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