https://github.com/syohex/go-texttable
go-texttable provides creating text table
https://github.com/syohex/go-texttable
Last synced: 2 months ago
JSON representation
go-texttable provides creating text table
- Host: GitHub
- URL: https://github.com/syohex/go-texttable
- Owner: syohex
- License: mit
- Created: 2013-07-09T13:10:07.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2020-09-19T02:43:42.000Z (almost 5 years ago)
- Last Synced: 2025-04-19T12:42:42.888Z (3 months ago)
- Language: Go
- Size: 102 KB
- Stars: 21
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-texttable 
## Sample Code
```go
package mainimport "github.com/syohex/go-texttable"
import "fmt"func main () {
tbl := &texttable.TextTable{}
tbl.SetHeader("Country", "Capital")tbl.AddRow("United States of America", "Washington D.C")
tbl.AddRow("France", "Paris")
tbl.AddRow("United Kingdom", "London")
tbl.AddRow("Japan", "Tokyo")
tbl.AddRow("Taiwan", "Taipei")fmt.Println(tbl.Draw())
}```
Output of above code is

`go-texttable` also supports multibyte characters such as Japanese.
```go
package mainimport "github.com/syohex/go-texttable"
import "fmt"func main () {
tbl := &texttable.TextTable{}
tbl.SetHeader("プログラミング言語", "よみがな", "作者")tbl.AddRow("Python", "ぱいそん", "グイド・ヴァンロッサム")
tbl.AddRow("Perl", "ぱーる", "ラリーウォール")
tbl.AddRow("Ruby", "るびぃ", "まつもとゆきひろ")
tbl.AddRow("Erlang", "あーらん", "ジョーアームストロング")
tbl.AddRow("D言語", "でぃーげんご", "ウォルター・ブライト")fmt.Println(tbl.Draw())
}
```