I also tried again to adapt the solution provided in the StackOverflow link from above with the toy example, but it still creates the same borked column names:
library(shiny)
ui <- fluidPage(
titlePanel("Old Faithful Geyser Data"),
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
mainPanel(
tags$head(tags$style(HTML('#faithful_data {border-collapse; }
#faithful_data table th { transform: rotate(-45deg)}'))),
column(6,tableOutput("faithful_data"))
)
)
)
server <- function(input, output) {
output$faithful_data <- renderTable({
faithful
},type = "html",
rotate.colnames = getOption("xtable.rotate.colnames", TRUE)
)
}
shinyApp(ui = ui, server = server)
This code, aiming to use the SO example more directly, produces normally formatted headers (no rotation, and no ancillary formatting text):
library(shiny)
ui <- fluidPage(
tags$head(tags$style(HTML('#faithful_data {border-collapse; }
#faithful_data table th { transform: rotate(-45deg)}'))),
column(6,tableOutput("faithful_data"))
)
server <- function(input, output) {
output$faithful_data <- renderTable({faithful}, type = 'html')
}
shinyApp(ui = ui, server = server)