A space after every five lines in the kable output (with the booktabs option) in the R Markdown document

I use knitr::kable()to render tables as part of the R Markdown document (which itself is part of the bookdown project ). In particular, the booktabs option (by setting the argument booktabsto equal TRUE) renders the table in a pleasant way. However, I would like there to be no space after every five lines.

Here, for example, is the code and the way the table is displayed in the bookdown demo when rendering in PDF format:

knitr::kable(
  head(iris, 20), caption = 'Here is a nice table!',
  booktabs = TRUE
)

iris table with booktabs

I would like the space that appears after every five lines not to be included, but I cannot find the parameter in knitr::kable()which it does this.

+11
source
1

, , , kable \addlinespace 5 , booktabs TRUE, :

linesep = if (booktabs) c('', '', '', '', '\\addlinespace') else '\\hline'

, linesep = "" kable().

knitr::kable(
  head(iris, 20), caption = 'Here is a nice table!',
  booktabs = TRUE,
  linesep = ""
)

enter image description here

\addlinespace kable .

, , . , linesep = c("", "", "", "\\hline") .

+20

Source: https://habr.com/ru/post/1694198/


All Articles