Skip to content
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

Right alignment? #38

Open
zsong opened this issue Sep 10, 2019 · 2 comments
Open

Right alignment? #38

zsong opened this issue Sep 10, 2019 · 2 comments

Comments

@zsong
Copy link

zsong commented Sep 10, 2019

All the values are left aligned. Does it support right alignment?

Thanks!

@Roslund
Copy link
Contributor

Roslund commented Sep 10, 2019

I have not tested this, but you could try changing TextTable.swift
This would change everything to right alignment.

func withPadding(count: Int) -> String {
    let length = self.strippedLength()

    if length < count {
-        return self +
-            repeatElement(" ", count: count - length).joined()
+       return repeatElement(" ", count: count - length).joined() + self         
    }
    return self
}

@zsong
Copy link
Author

zsong commented Sep 13, 2019

I submitted a pull request. No test, just code but I tested it locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants