Is it possible to adjust the width of columns when making tables with the kable() function in knitr?
A chunk like this for a table with two columns produces a table that takes up the entire width of the document. I'd like to make the columns narrower. Can this be done with kable() or is another package needed?
This rmarkdown chunk
```{r}
df <- data.frame(x = 1:10,
y = 11:20)
library(knitr)
kable(df)
```
Aligning left with kable(df, align = "l")
helps a little but I'd like the two columns adjacent to each other.
knitr::kable(x, format = "html", table.attr = "style='width:30%;'")
from (twitter.com/vrnijs/status/599275956247789568) – MarBlo