rmarkdown icon indicating copy to clipboard operation
rmarkdown copied to clipboard

Consider adding "gt" as an available `df_print` option

Open jooyoungseo opened this issue 1 year ago • 2 comments

gt::gt() has and will have many accessibility benefits as opposed to other df_print methods, such as knitr::kable(), etc. Although it's possible to customize knitr::knit_print.data.frame s3 method, it would be more convenient for users to have an option to choose gt for their df_print method. Additional benefit is that gt can be used for html, latex, word, and rtf, altogether.

jooyoungseo avatar Aug 24 '22 22:08 jooyoungseo

Thanks ! That is a good idea. df_print feature is quite simple and gt offers a lot a feature to customize table. So I don't know what would be a simple default GT table that df_print could offer.

I believe gt user are more at ease by directly customizing their tables.

Anyway, I like the idea and we'll think about it. cc @rich-iannone

By the way, you can already pass custom function to df_print: https://bookdown.org/yihui/rmarkdown/html-document.html#custom-fun-dfprint

Did you try something with this already ?

cderv avatar Aug 25 '22 08:08 cderv

FYI, the following does not produce gt table:


---
title: test
output:
  html_document:
    df_print: !expr gt::gt
---

```{r}
head(iris)
```

jooyoungseo avatar Sep 10 '22 19:09 jooyoungseo