Merge pull request #222 from ryanlewis/master

Table render improvements
This commit is contained in:
Caleb Bassi
2019-02-01 21:21:45 -08:00
2 changed files with 45 additions and 4 deletions

View File

@@ -43,6 +43,24 @@ func main() {
ui.Render(table2)
table3 := widgets.NewTable()
table3.Rows = [][]string{
[]string{"header1", "header2", "header3"},
[]string{"AAA", "BBB", "CCC"},
[]string{"DDD", "EEE", "FFF"},
[]string{"GGG", "HHH", "III"},
}
table3.TextStyle = ui.NewStyle(ui.ColorWhite)
table3.RowSeparator = true
table3.BorderStyle = ui.NewStyle(ui.ColorGreen)
table3.SetRect(0, 30, 70, 20)
table3.FillRow = true
table3.RowStyles[0] = ui.NewStyle(ui.ColorWhite, ui.ColorBlack, ui.ModifierBold)
table3.RowStyles[2] = ui.NewStyle(ui.ColorWhite, ui.ColorRed, ui.ModifierBold)
table3.RowStyles[3] = ui.NewStyle(ui.ColorYellow)
ui.Render(table3)
uiEvents := ui.PollEvents()
for {
e := <-uiEvents