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

Support text justification in ggtexttable #18

Closed
cj-wilson opened this issue Aug 2, 2017 · 3 comments
Closed

Support text justification in ggtexttable #18

cj-wilson opened this issue Aug 2, 2017 · 3 comments

Comments

@cj-wilson
Copy link

I would like to support text justification in ggtexttable such that I can align financial data better. I noticed that tableGrob supports an "hjust" parameter (below) but I'm not able to find a way to pass that in to the ggtexttable function.

https://cran.r-project.org/web/packages/gridExtra/vignettes/tableGrob.html

Great package! If I knew were to plug this in I'd offer a PR. Thank you.

@kassambara
Copy link
Owner

kassambara commented Aug 10, 2017

Support for text justification added now, thank you.

This has been added in the documentation of ggtexttable():

# Text justification
#::::::::::::::::::::::::::::::::::::::::::::::
# Default is "centre" for the body and header, and "right" for the row names. 
# Left justification: hjust=0, x=0.1
# Right justification: hjust=1, x=0.9
library(ggpubr)
ggtexttable(head(iris), rows = NULL,
            theme = ttheme(
              colnames.style = colnames_style(color = "white", fill = "#8cc257"),
              tbody.style = tbody_style(color = "black", fill = c("#e8f3de", "#d3e8bb"), hjust=1, x=0.9)
            )
)

@kassambara
Copy link
Owner

can we close this issue?

@kurttaylor
Copy link

Is it possible to justify text in certain columns/rows?

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

3 participants