layout-ncol
Use the layout-ncol
chunk option to organize output in columns, e.g., layout-ncol: 2
for two tables side-by-side.
```{r}
#| label: tbl-label
#| tbl-cap: Two tables
#| tbl-subcap: ["mtcars", "Just cars"]
#| layout-ncol: 2
library(knitr)
# table on the left
kable(head(mtcars[, 1:3]))
# table on the right
kable(head(cars))
```
mpg | cyl | disp | |
---|---|---|---|
Mazda RX4 | 21.0 | 6 | 160 |
Mazda RX4 Wag | 21.0 | 6 | 160 |
Datsun 710 | 22.8 | 4 | 108 |
Hornet 4 Drive | 21.4 | 6 | 258 |
Hornet Sportabout | 18.7 | 8 | 360 |
Valiant | 18.1 | 6 | 225 |
speed | dist |
---|---|
4 | 2 |
4 | 10 |
7 | 4 |
7 | 22 |
8 | 16 |
9 | 10 |