1

I have built a Shiny app and one page has a very wide reactable table. Some users are having trouble navigating the width of the table. How can I add horizontal and vertical scroll bars they can click and drag? Here is a minimal example.

library(shiny)
library(dplyr)
library(reactable)

ui <- fluidPage(
  titlePanel("reactable example"),
  reactableOutput("table")
)

iris_wide <- iris %>% bind_cols(iris) %>% bind_cols(iris) %>% bind_cols(iris) %>% bind_cols(iris) %>% bind_cols(iris) %>% bind_cols(iris)

server <- function(input, output, session) {
  output$table <- renderReactable({
    reactable(iris_wide)
  })
}

shinyApp(ui, server)
bretauv
  • 7,756
  • 2
  • 20
  • 57
pyll
  • 1,688
  • 1
  • 26
  • 44
  • The horizontal scrollbar appears for me. Do you have more info about when it doesn't appear for your users? Also, you can add `overflow: scroll` in the CSS of the table to add scrollbars. – bretauv Jun 06 '22 at 18:24
  • Are you on a windows device? I am on mac. Maybe that makes a difference? – pyll Jun 06 '22 at 22:16
  • 3
    A: vertical scroll bar (keeping pagination) - `reactable(iris_wide, height = 250)` B: vertical scroll bar (without pagination) - `reactable(iris_wide, pagination = FALSE, height = 600)`. Also, you can control your horizontal scroll bar with `width`: `reactable(iris_wide, pagination = FALSE, height = 600, width = 500)`. – Radovan Miletić Jun 11 '22 at 18:14

0 Answers0