1
0
mirror of https://github.com/gizak/termui.git synced 2025-04-26 13:48:54 +08:00

example of borderless table

This commit is contained in:
Igor Pidik 2022-10-02 19:46:53 +02:00
parent c19e015998
commit e2f763c193

View File

@ -2,6 +2,7 @@
// Use of this source code is governed by a MIT license that can // Use of this source code is governed by a MIT license that can
// be found in the LICENSE file. // be found in the LICENSE file.
//go:build ignore
// +build ignore // +build ignore
package main package main
@ -61,6 +62,21 @@ func main() {
ui.Render(table3) ui.Render(table3)
borderlessTable := widgets.NewTable()
borderlessTable.Rows = [][]string{
[]string{"header1", "header2", "header3"},
[]string{"Foundations", "Go-lang is so cool", "Im working on Ruby"},
[]string{"2016", "11", "11"},
}
borderlessTable.TextStyle = ui.NewStyle(ui.ColorWhite)
borderlessTable.TextAlignment = ui.AlignCenter
borderlessTable.SetRect(0, 30, 60, 35)
borderlessTable.Border = false
borderlessTable.RowSeparator = false
borderlessTable.ColSeparator = false
ui.Render(borderlessTable)
uiEvents := ui.PollEvents() uiEvents := ui.PollEvents()
for { for {
e := <-uiEvents e := <-uiEvents