asciitable

package
v3.1.12+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package asciitable implements a simple ASCII table formatter for printing tabular values into a text terminal.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

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

Table holds tabular values in a rows and columns format.

func MakeHeadlessTable

func MakeHeadlessTable(columnCount int) Table

MakeTable creates a new instance of the table without any column names. The number of columns is required.

func MakeTable

func MakeTable(headers []string) Table

MakeTable creates a new instance of the table with given column names.

Example
Output:

func (*Table) AddRow

func (t *Table) AddRow(row []string)

AddRow adds a row of cells to the table.

func (*Table) AsBuffer

func (t *Table) AsBuffer() *bytes.Buffer

AsBuffer returns a *bytes.Buffer with the printed output of the table.

func (*Table) IsHeadless

func (t *Table) IsHeadless() bool

IsHeadless returns true if none of the table title cells contains any text.

Jump to

Keyboard shortcuts

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