Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

More flexibility with fonts and alignments #474

Open
hafen opened this issue Sep 21, 2024 · 1 comment
Open

More flexibility with fonts and alignments #474

hafen opened this issue Sep 21, 2024 · 1 comment

Comments

@hafen
Copy link

hafen commented Sep 21, 2024

It appears that the idea of a monospaced font is baked into this package, since for example alignment is handled by adding spaces to the table cells which only works for monospaced fonts.

While I understand and prefer the benefits of using monospaced fonts for reporting numbers, there are many users who have styles they must adhere to within their company that use proportional fonts. I have been able to change the font of table contents by overriding the gt::tab_style() that is set by tfrmt, but then things like right alignment get messed up. It would be nice to be able to change the font more easily and then have more flexibility over alignment such as center-aligning columns.

@bzkrouse
Copy link
Collaborator

@hafen Thank you for your suggestion! You are right that we achieve alignment by padding values, and that is designed for monospaced fonts. This allows for more precise control over alignment.
Can I ask, if you change the font with tab_style(), does using gt::cols_align(align = "center") for alignment give the desired result? Or are there issues?
Thanks!

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

No branches or pull requests

2 participants