mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #227] Feature request: add columns of fixed width #173
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#173
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sacules on GitHub (Jan 18, 2019).
Original GitHub issue: https://github.com/rivo/tview/issues/227
Hello, I'm loving tview and using it to build a small music tagger. I'd like to ask something similar to #119: I have a table of content and I'd like to assign a fixed width to each column (with the possibility of resizing them on the fly), and wrapping the text that doesn't fit, or displaying "..." at the end of it.
@dguendisch commented on GitHub (Jan 18, 2019):
That's at least possible on cell level, see https://github.com/rivo/tview/blob/master/table.go#L74
Just give all your cells in a column the respective maxWidth and tview will append a nice
…for every cell text exceeding the maxWidth, effectively limiting your column width.Haven't seen a way though on how to specify this on a table or column level (instead of every single cell), but haven't looked deeply for such.
@rivo commented on GitHub (Jan 22, 2019):
Thanks to @dguendisch for providing the correct answer here.
@Sacules, let us know if this solves your problem.
@Sacules commented on GitHub (Feb 2, 2019):
Yeah it works by now, thanks!
@jsumners-nr commented on GitHub (Oct 16, 2024):
For those looking at this in the future, the static link is
github.com/rivo/tview@e5e361b9d7/table.go (L74)