Add "compact mode" for table rendering #573
pete-woods
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
At the moment, if you use
glamour.WithWordWrap(terminalWidth), tables will aim to occupy the full width of your terminal.If you do not want this, you can set
glamour.WithWordWrap(0), however this makes glamour unaware of your terminal's width, so it picks what looks like 120 as the maximum, preventing supporting anything wider.I'd propose adding a new
WithTableFitContentoption (I don't feel strongly about the name) in order to enable this behaviour.This is mainly to make output look nicer when you have a very wide terminal.
See related issue.
I've made two simple PRs, showing what an implementation might look like:
ContentWidthproperty to table renderer lipgloss#697Beta Was this translation helpful? Give feedback.
All reactions