[GH-ISSUE #1094] Possible bug or misconfiguration in table #793

Open
opened 2026-03-04 01:07:48 +03:00 by kerem · 1 comment
Owner

Originally created by @manuecg on GitHub (May 21, 2025).
Original GitHub issue: https://github.com/rivo/tview/issues/1094

Hi, I'm trying to display long text entries in a table by scrolling horizontally (using the right arrow key). While horizontal scrolling does occur, the full text is not completely visible at the end.
I'm using setMaxWidth(0), so I wonder if I'm missing a required property or if this could be a bug

	table := tview.NewTable().
		SetBorders(true)
	lorem := strings.Split("Lorem ipsum dolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolorEND ", " ")
	cols, rows := 3, 1
	word := 0
	for r := 0; r < rows; r++ {
		for c := 0; c < cols; c++ {
			color := tcell.ColorWhite
			if c < 1 || r < 1 {
				color = tcell.ColorYellow
			}
			table.SetCell(r, c,
				tview.NewTableCell(lorem[word]).
					SetTextColor(color).SetMaxWidth(0).
					SetAlign(tview.AlignCenter))
			word = (word + 1) % len(lorem)
		}
	}
	table.Select(0, 0).SetDoneFunc(func(key tcell.Key) {
		if key == tcell.KeyEscape {
			app.Stop()
		}
	})
	if err := app.SetRoot(table, true).SetFocus(table).Run(); err != nil {
		panic(err)
	}```
Originally created by @manuecg on GitHub (May 21, 2025). Original GitHub issue: https://github.com/rivo/tview/issues/1094 Hi, I'm trying to display long text entries in a table by scrolling horizontally (using the right arrow key). While horizontal scrolling does occur, the full text is not completely visible at the end. I'm using setMaxWidth(0), so I wonder if I'm missing a required property or if this could be a bug ``` app := tview.NewApplication() table := tview.NewTable(). SetBorders(true) lorem := strings.Split("Lorem ipsum dolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolordolorEND ", " ") cols, rows := 3, 1 word := 0 for r := 0; r < rows; r++ { for c := 0; c < cols; c++ { color := tcell.ColorWhite if c < 1 || r < 1 { color = tcell.ColorYellow } table.SetCell(r, c, tview.NewTableCell(lorem[word]). SetTextColor(color).SetMaxWidth(0). SetAlign(tview.AlignCenter)) word = (word + 1) % len(lorem) } } table.Select(0, 0).SetDoneFunc(func(key tcell.Key) { if key == tcell.KeyEscape { app.Stop() } }) if err := app.SetRoot(table, true).SetFocus(table).Run(); err != nil { panic(err) }```
Author
Owner

@rivo commented on GitHub (Aug 27, 2025):

Horizontal scrolling on tables is not by character but by table column. When you hit the right arrow key two times, you've scrolled to the last (i.e. right-most) column. There's no more scrolling afterwards. You'll want to find ways to keep your cell contents short / narrow.

<!-- gh-comment-id:3228756249 --> @rivo commented on GitHub (Aug 27, 2025): Horizontal scrolling on tables is not by character but by table column. When you hit the right arrow key two times, you've scrolled to the last (i.e. right-most) column. There's no more scrolling afterwards. You'll want to find ways to keep your cell contents short / narrow.
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#793
No description provided.