Categorygithub.com/muesli/gotable
modulepackage
0.0.0-20210307142814-960606545b8b
Repository: https://github.com/muesli/gotable.git
Documentation: pkg.go.dev

# README

gotable

Build Status Go ReportCard GoDoc

Go helper to print a table of data to stdout or an io.Writer.

Installation

go get github.com/muesli/gotable

Example

package main

import (
	"github.com/muesli/gotable"
)

func main() {
	tab := gotable.NewTable([]string{"Fruit", "Yumminess", "Color"},
		[]int64{-40, -20, 15},
		"No data in table.")

	tab.AppendRow([]interface{}{"Banana", "very", "yellow"})
	tab.AppendRow([]interface{}{"Pear", "much", "depends"})
	tab.AppendRow([]interface{}{"Pineapple", "delicious", "pineappley"})

	tab.Print()
}

What it looks like

Fruit                                     Yumminess                       Color
-------------------------------------------------------------------------------
Banana                                    very                           yellow
Pear                                      much                          depends
Pineapple                                 delicious                  pineappley

# Packages

No description provided by the author

# Functions

NewTable returns a new table.
NewTable returns a new table.

# Structs

Table is a helper for printing data in sheet form.