This is I'm sure a very simple problem that belies my lack of understanding of kable / css
I'm making a simple kable, e.g.
kable(mtcars)
I'd love it to have a border around the whole table and the caption, with some white space between the border and its contents.
I've achieved this with the css code:
table {
border: 1px solid black;
padding: 20px;
}
But there are two problems:
I've tried an outline with an offset:
table {
outline:1px solid black;
outline-offset: 20px;
}
But then my text wraps too tight, and the box cuts over it
You could use a div block, e.g.
---
title: "Title"
output: html_document
---
:::{.border style="padding: 10px; border: 1px solid #dee2e6 !important;"}
```{r}
#| echo: false
mtcars[1:5,] |> kableExtra::kbl(caption = "Caption") |> kableExtra::kable_styling()
```
:::