-
Notifications
You must be signed in to change notification settings - Fork 124
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
feat: add suppressTrailingSpaces to remove all trailing spaces in final column #287
feat: add suppressTrailingSpaces to remove all trailing spaces in final column #287
Conversation
I hope this is OK for me to submit. It isn't super important that it gets merged, I can deal with the trailing spaces. But it would be nice to be able to disable them as required for cleaner output. |
Pull Request Test Coverage Report for Build 7404733626
💛 - Coveralls |
Can you show what happens when |
4143601
to
3d37bed
Compare
I added coverage in the tests to show how this looks when borders are turned on (they look bad as expected) |
Yeah this code cannot be merged in this state. How about just adding a block of code after https://github.com/jedib0t/go-pretty/blob/main/table/table.go#L681? If the suppressTrailingSpaces is set to true, split the outStr into lines, and then trim each line before returning that? |
2e85ce9
to
2b3820c
Compare
Ahh, that works even better, thanks for the tip. And it retains the table shape when borders are present which is better than what I originally proposed.
|
2b3820c
to
10c9756
Compare
|
Proposed Changes
SuppressTrailingSpaces
that removes all the trailing spaces in the final column of a row. This is useful when using theOptionsNoBordersAndSeparators
options to reduce the number of spaces at the end of the column.