Rotate headers of a reactable in R Shiny
Solution 1:
Not sure what your expected result looks like, but how about this:
library(shiny)
library(reactable)
ui <- fluidPage(reactableOutput('rt'))
server <- function(input, output) {
output$rt <- renderReactable({
reactable(
mtcars[1:4, 1:5],
fullWidth = F,
defaultColDef = colDef(
align = "center",
minWidth = 70,
headerStyle = list(
`white-space` = "nowrap",
`transform-origin` = "50% 50%",
transform = "rotate(-90deg)",
`margin-top` = "10px",
`margin-bottom` = "10px",
borderColor = "#ffffff"
)
)
)
})
}
shinyApp(ui = ui, server = server)
This answer was useful to get here.