Skip to content

Possible bug or misconfiguration in table #1094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
manuecg opened this issue May 21, 2025 · 0 comments
Open

Possible bug or misconfiguration in table #1094

manuecg opened this issue May 21, 2025 · 0 comments

Comments

@manuecg
Copy link

manuecg commented May 21, 2025

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)
	}```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant