0

I'm hunting for a solution that would allow me to control the output of a kableExtra table in a rmdformats document.

Running example like that I get a table with a horizontal scroll bar at the bottom.

---
output:
  rmdformats::robobook:
    code_folding: show
    self_contained: true
    highlight: pygments
editor_options: 
  chunk_output_type: console
---

```{r}
library(kableExtra)
dt <- cbind(mtcars[1:5, 1:6],mtcars[1:5, 1:6])
```

```{r}
dt %>%
  kbl() %>%
  kable_styling()
```

enter image description here

This is not working well for largish tables and having so much wide space around I wanted to increase the table width.

I tried tinkering with knitr chunk options but this seems to only affect figures. Same goes for rmdformats options. Would some css be needed?

apaderno
  • 28,547
  • 16
  • 75
  • 90
radek
  • 7,240
  • 8
  • 58
  • 83

1 Answers1

1

Answers from here or here point to css solution which works by adding this section right under YAML

<style type="text/css">
div.page-inner {
  max-width: 10000px !important;
}
</style>
radek
  • 7,240
  • 8
  • 58
  • 83