hughjonesd / huxtable

An R package to create styled tables in multiple output formats, with a friendly, modern interface.
http://hughjonesd.github.io/huxtable
Other
321 stars 28 forks source link

Table prints off-center in Rmarkdown with PDF output #35

Closed kstierhoff closed 6 years ago

kstierhoff commented 6 years ago

Hi, When knitting to PDF, the huxtable is off-center. Is there a way to have it centered in the page? I apologize for no reproducible code, but can provide any additional info/files as needed. Interestingly, doing: library(huxtable) hux(summary(cars)) in a new .Rmd file is centered. Seems to be some padding on my hux object. Thanks, Kevin

image

hughjonesd commented 6 years ago

See ?position and ?width. I haven't found perfect solutions to this but setting the width right seems to be key.

kstierhoff commented 6 years ago

Yes, setting position(x) <- 'left' aligns it properly, but I must adjust (shorten) the column names to fit the table on the page. Thanks for the quick reply!