A simple utility to make ascii tables.
Each row must have the same amount of columns.
package main
import (
"github.com/theverything/table"
)
func main() {
rows := [][]string{
{"foo", "bar", "bing", "bong"},
{"fizz", "buzz", "hello", "world"},
{"one", "two", "three", "four"},
{"1", "2", "3", "4"},
}
fmt.Println(table.Create(rows))
}
+-----------------------------+
| foo | bar | bing | bong |
+-----------------------------+
| fizz | buzz | hello | world |
+-----------------------------+
| one | two | three | four |
+-----------------------------+
| 1 | 2 | 3 | 4 |
+-----------------------------+