-
Notifications
You must be signed in to change notification settings - Fork 33
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] Vertical alignment #75
Comments
Thanks :) I see how this can be useful. It should also be rather easy to implement. I guess it would make sense to simply reuse the Right now we have I'm also thinking about where to add these functions. To I usually opt for Would it be acceptible to set the alignment for the individual |
I wonder if it could be made into a bit flag without breaking the API. You could then do something like
With bit flags, or just all options in one enum, it would stay the same call, without renaming the function. So, hopefully, existing code would function as-is.
I'd say at least Speaking of headers - it would probably need to be a separate issue, but it would be nice to have them more generalized as well. Like a summary (think financial tables) or a header column - say, when you do a comparison table or something. |
I really like the idea approach via How would you handle something like I.e.
I guess this would result in a breaking change, as the current It would also probably make sense to add a new helper enum |
For reference, here's how Qt does it. I did some quick experimentation with
Partly because
For clarity, I'll be using I believe that setting one flag, as well as both of them (for center), is obvious. The only question here is how to handle when no flags for the axis are set. IE if neither
There are good arguments both way - using (The same goes for vertical, skipped for the sake of brevity). |
You're most likely no longer using this library, but here's my answer 😓 Your proposal sounded straight forward and well thought out, so I guess you'll come up with a good implementation as well. Proper testing would be needed though! |
Frankly, I barely touched Rust over the past year. So there's that. And I don't remember anything related to this issue, sadly. Am just now getting back to coding in Rust at work, but that's an entirely different thing. Iirc I do use comfy-tables in a few places though. FWIW, I'm pretty sure the screenshot in OP was taken from this repo: https://github.com/jaskij/systemd-unit-status |
I'm honestly impressed by
comfy-table
, and it handled a multiline string like a champ. What I would like to ask is for the ability to set vertical alignment (perhaps through a new enum and method, perhaps through adding new values toCellAlignment
).For example, in the table from this screenshot below, I would like the single line text in the header to be in the lower line, so that
unit
,status
andstate transition
are all in the same line.The text was updated successfully, but these errors were encountered: