Quantcast
Channel: Active questions tagged kable - Stack Overflow
Viewing all articles
Browse latest Browse all 106

Removing Separator Line in Table Created with kbl in R

$
0
0

I'm working with R and have created a table using kableExtra. My table includes categories, counts, and values in Dollars, with subheadings under "Count," "Values," "(n)," and "in Dollars." The table already has some horizontal lines in place, but I'd like to customize it further.

Specifically, I want to:Remove the horizontal lines under "Count," "Values," "(n)," and "in Dollars."Keep the other existing horizontal lines in the table.

Thank you for your assistance!

# Load the required librarieslibrary(kableExtra)library(dplyr)# Create example data (you can customize this to your data)data <- data.frame(  Category = c("Toyota", "Honda", "Ford", "Nissan"),  Count = c(50, 60, 45, 55),  Minimum = c(100, 110, 95, 105),  Maximum = c(200, 210, 195, 205))# Create the tabletable <- kbl(data, booktabs = TRUE) %>%  kable_styling(latex_options = c("striped"), font_size = 10, position = "center") %>%  add_header_above(c(" " = 1, "(n)" = 1, "in Dollars" = 2)) %>%  add_header_above(c(" " = 1, "Count" = 1, "Values" = 2))# Display the tabletable

Viewing all articles
Browse latest Browse all 106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>