Tim
Tim

Reputation: 7464

How to change font size in knitr::kable in Beamer slides?

In Beamer presentation created using rmarkdown I have a slide with table, e.g.

## Slide with table

```{r, asis = TRUE}
dat <- mtcars
knitr::kable(dat)
```

How can I control the font size so that the whole table fits the slide?

Upvotes: 2

Views: 1632

Answers (1)

cmaimone
cmaimone

Reputation: 576

I'd suggest trying the kableExtra package.

Otherwise, the easiest way I know of is to specify a CSS class for the table and then define the font size in CSS. See how to colour different Rmarkdown kable tables in different colour

Upvotes: 3

Related Questions