tview
tview copied to clipboard
Enabling the fullscreen option on SetRoot has no effect on root table primitive
create table:
table := tview.NewTable()
for r, entry := range tuples {
for c := 0; c < 2; c++ {
val := entry.Path
if c == 1 {
val = entry.Size
}
table.SetCell(r, c,
tview.NewTableCell(val).
SetTextColor(tcell.ColorWhite).
SetAlign(tview.AlignCenter)).
SetSelectable(true, false)
}
}
The table does not take up the full width of the terminal:
if err := app.SetRoot(table, true).Run(); err != nil {
panic(err)
}
Is there something that I am doing wrong or is this a bug?
By default, a table cell will only be as wide as its content. If you want it to expand when there is more space available, you need to set the expansion parameter to a positive value.