Open npelikan opened 5 years ago
Thanks for the feature request, and it sounds like a good one!
The first option would be great and certainly would be great for a variety of use cases (and it's requested in https://github.com/rstudio/gt/issues/96). I'm not sure how much work the second option would entail but I agree it would be a step up from the first option.
I've done some looking into the first option (image output) and I'm trying to find a solution. It seems like using webshot might work. Another option (difficult though) would be to create SVG output (in much the same way we create HTML output) and then use rsvg to convert to different image formats. There are probably other solutions as well (I'm hoping they might be easier/better).
RE the second option: https://github.com/davidgohel/flextable looks like it has knitr+pptx support
Hi, As a work around the webshot package works for me:
gt <- table
library(htmltools) save_html(html(gt::as_raw_html(gt )), "table.html", background = "white") webshot::webshot(url = "table.html", file = "table.png")
With futher options via webshot.
Hi! Playing around with your package and the dev version of RStudio, I've noticed that
gt
tables don't print with any formatting when output to .pptx, instead just printing raw text. Two solutions I can see, in ascending order of complexity: 1) Output the formatted table as an immutable image and 2) Output into a native .pptx tablesReprex:
Slide with GT output