Hi John!
I'm able to get the borders, as you may find below in the code. However, I couldn't get the thicker lines. From this post, I guess it may be done using CSS, which I don't know at all. You may be able to figure it out, and if you do, can I request you to share the solution?
This is my Rmd code:
---
title: "Untitled"
output: pdf_document
---
some text
```{r}
library(kableExtra)
dt <- data.frame(stringsAsFactors = FALSE,
c("A", "A", "B", "B", "C", "C"),
c(74, 52, 49, 68, 97, 23),
c(36, 60, 24, 36, 75, 29),
c(20, 16, 39, 98, 6, 64),
c(43, 84, 3, 57, 35, 9),
c(75, 36, 20, 70, 60, 37),
c(31, 7, 40, 81, 65, 74))
names(x = dt) <- c("ProductID", "M", "F", "M", "F", "M", "F")
dt %>%
kable() %>%
kable_styling(bootstrap_options = "bordered",
full_width = FALSE) %>%
add_header_above(header = c("", "Apple" = 2, "Orange" = 2, "Grapes" = 2),
bold = TRUE,
border_left = TRUE,
border_right = TRUE) %>%
row_spec(row = 0,
bold = TRUE) %>%
column_spec(column = 1,
border_left = TRUE) %>%
column_spec(column = 7,
border_right = TRUE) %>%
collapse_rows(columns = 1,
valign = "middle")
```
some text
And, here's the output: try.pdf (127.5 KB).