tabby
tabby copied to clipboard
AddHeader It's not a good name
AddHeader
declares the table header does not necessarily add, the example below explains better my point of view
package main
import "github.com/cheynewallace/tabby"
func main(){
t := tabby.New()
t.AddHeader("NAME", "TITLE", "DEPARTMENT")
t.AddLine("John Smith", "Developer", "Engineering")
t.AddHeader("NAME", "TITLE", "DEPARTMENT")
t.Print()
}
OUT:
NAME TITLE DEPARTMENT
---- ----- ----------
John Smith Developer Engineering
SetHeader
sounds better
Random user here...
I see what you mean. And actually I think this would be a good enhancement when one is outputting 10s of lines it is good to throw the header in there every N lines.
Alternatively one could say t.AddHeader("NAME", "TITLE", "DEPARTMENT", N)
to automatically add it every N lines.