improve html grouped header row
diff --git a/R/add_header_above.R b/R/add_header_above.R
index e50261e..92e2040 100644
--- a/R/add_header_above.R
+++ b/R/add_header_above.R
@@ -69,8 +69,12 @@
htmlTable_new_header_generator <- function(header_df) {
header_items <- apply(header_df, 1, function(x) {
- paste0('<th style="text-align:center;" colspan="', x[2], '">',
- x[1], '</th>')
+ if (x[2] == 1 | trimws(x[1]) == "") {
+ paste0('<th style="border-bottom:hidden"></th>')
+ } else {
+ paste0('<th style="text-align:center;" colspan="', x[2], '">',
+ x[1], '</th>')
+ }
})
header_text <- paste(c("<tr>", header_items, "</tr>"), collapse = "")
header_xml <- read_xml(header_text, options = c("COMPACT"))