I want to add a vertical line between groups of columns. Here is a desired outcome:
---------
g1 | g2
---------
a b | a b
---------
1 2 | 3 4
---------
and a shiny app to start with:
library(shiny)
library(DT)
library(htmltools)
runApp(shinyApp(
ui <- basicPage(
DT::dataTableOutput('table1')
),
server = function(input, output) {
output$table1 <- DT::renderDataTable({
datatable(data.frame(a1 = 1, b1 = 2, a2 = 3, b2 = 4), rownames = FALSE,
container = withTags(table(
class = 'display',
thead(
tr(
th(colspan = 2, 'g1'),
th(colspan = 2, 'g2')
),
tr(
lapply(rep(c('a', 'b'), 2), th)
)
)
))
)
})
}
))
Current output from shiny app above: