How to make have vertical lines instead of horizontal lines in kableextra R

Viewed 140

Are there any way to remove horizontal lines in kable_styling() and have vertical lines instead when reporting rmarkdown as pdf?

library(kableExtra)
head(mtcars) %>%
  kbl() %>%
  kable_styling()

enter image description here

1 Answers

What you could do is a combination of booktabs and border_right, e.g.

library(kableExtra)
library(dplyr)
head(mtcars) %>%
  kbl(booktabs = T) %>%
  kable_styling() %>% 
 column_spec(c(1:ncol(mtcars)),
    border_right = T
  )
Related