table

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package table provides functions for handling tables in terminal

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Data [][]string
}

Options represents the options that can be set when creating a new table

type Table

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

Table represent a table

func New

func New(o Options) (*Table, error)

New returns a table by the given options

func (*Table) AddRow

func (t *Table) AddRow(row int, cols ...string) error

AddRow adds a row by the given row number and column values

func (*Table) Data

func (t *Table) Data() [][]string

Data returns the data of the table

func (*Table) FormattedData

func (t *Table) FormattedData() string

FormattedData returns the formatted table data

func (*Table) SetData

func (t *Table) SetData(row, col int, val string) error

SetData sets the table data by the given row, column and value

Jump to

Keyboard shortcuts

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