-
Notifications
You must be signed in to change notification settings - Fork 125
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
Feature: set column max width (or automatically truncate input) #1
Comments
This has been partially fixed here: #11 |
Any plans/progress implementing the max column width, too? Word wrapping might take substantial effort to implement, but there are applications which would accept broken layout for values which are too long, like this:
It's "garbage in, garbage out", fair principle. |
I thought about One problem that sprung to mind was having multiple cells with colspans and one of the columns has a max_width... So - no plans, sorry. If you have values that should have a |
No problem, just wanted to confirm. Looks like using text tables for development reports (my case) and E.g. I'm okay with no fancy decorative features like colspans and ----- Original Message ----- I thought about One problem that sprung to mind was having multiple cells with colspans and one of the columns has a max_width... So - no plans, sorry. If you have values that should have a Reply to this email directly or view it on GitHub: |
You can (indirectly) set the max-width by controlling the input data. That is not as sweet as setting |
I wrote the following code to wrap (break-word) a string in i18n-tasks: def wrap_string(s, max)
chars = []
dist = 0
s.chars.each do |c|
chars << c
dist += 1
if c == "\n"
dist = 0
elsif dist == max
dist = 0
chars << "\n"
end
end
chars = chars[0..-2] if chars.last == "\n"
chars.join
end |
In a similar vain, I would find it great if Terminal-Table had a |
Hello,
I really appreciate what you did here! I was wondering if/when you are planning to add an optional max width for a column, with some kind of word wrap, or even just respecting newlines in a string and looking at the longest line only.
Thanks!
Christoph
The text was updated successfully, but these errors were encountered: