Skip to content

stny/chocotable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chocotable

Build Status codecov Go Report Card

choco

Example

tbl := &chocotable.Table{}
tbl.AddRow([]string{"1", "Hello"})
tbl.AddRow([]string{"2", "World!"})
tbl.AddRow([2]string{"3", "ham egg tomate"})
tbl.AddRow([]string{"4", "アイウエオ"})
tbl.AddRow([]interface{}{5, "Lorem Ipsum"})
tbl.AddRow(struct {
	ID   int
	Name string
}{6, "Golang"})
s := tbl.Render()
// or
tbl.Println()

Output:

┌───┬────────────────┐
│ 1 │ Hello          │
├───┼────────────────┤
│ 2 │ World!         │
├───┼────────────────┤
│ 3 │ ham egg tomate │
├───┼────────────────┤
│ 4 │ アイウエオ     │
├───┼────────────────┤
│ 5 │ Lorem Ipsum    │
├───┼────────────────┤
│ 6 │ Golang         │
└───┴────────────────┘

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages