I am planning to move from R Markdown to Quarto for parameterised reporting, but one appearance issue has prevented me from progressing further.
In R Markdown, the preview of a gt table looks identical to the knitted HTML file:
However, in Quarto, while the preview of a gt table appears the same as above, the rendered HTML file looks different:
The table includes stripes, which should be FALSE
by default based on the gt documentation. Even if I explicitly turn it off using opt_row_striping(row_striping = FALSE)
, the issue persists:
How can I resolve this so that the output matches the preview?
The full quarto code example can be found below:
---
title: "GT tables"
format:
html:
embed-resources: true
---
#| message: false
library(gt)
library(dplyr)
iris |>
slice_head(n = 5) |>
gt()
iris |>
slice_head(n = 5) |>
gt() |>
opt_row_striping(row_striping = FALSE)
By default Quarto modifies some table properties when rendering gt (and other computational) tables, most noticeably adding a bootstrap class that includes row striping. In gt
's case you can disable this by using tab_options(quarto.disable_processing = TRUE)
:
---
title: "GT tables"
format:
html:
embed-resources: true
---
```{r}
#| message: false
library(gt)
library(dplyr)
iris |>
slice_head(n = 5) |>
gt() |>
tab_options(quarto.disable_processing = TRUE)
```