[GH-ISSUE #740] Enabling the fullscreen option on SetRoot has no effect on root table primitive #542

Closed
opened 2026-03-04 01:05:53 +03:00 by kerem · 1 comment
Owner

Originally created by @ninjarogue on GitHub (Jul 1, 2022).
Original GitHub issue: https://github.com/rivo/tview/issues/740

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?

Originally created by @ninjarogue on GitHub (Jul 1, 2022). Original GitHub issue: https://github.com/rivo/tview/issues/740 create table: ```go 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: ```go if err := app.SetRoot(table, true).Run(); err != nil { panic(err) } ``` Is there something that I am doing wrong or is this a bug?
kerem closed this issue 2026-03-04 01:05:53 +03:00
Author
Owner

@rivo commented on GitHub (Aug 11, 2022):

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.

<!-- gh-comment-id:1212422072 --> @rivo commented on GitHub (Aug 11, 2022): 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](https://pkg.go.dev/github.com/rivo/tview#TableCell.SetExpansion) to a positive value.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#542
No description provided.