I have a datatable that I want to show in R Shiny, but I want the header column that has the column names to be red and the text to be in white. With formatStyles(), I can only specify entire columns instead of just the row of header names. How would you recommend to tackle this?
library(shiny)
library(dplyr)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
),
mainPanel(
DT::DTOutput("table")
)
))
server <- function(input, output) {
data <- tibble(name = c("Justin", "Corey", "Sibley"),
grade = c(50, 100, 100))
output$table <- renderDT({
datatable(data)
})
}
# Run the application
shinyApp(ui = ui, server = server)