Mandy
Mandy

Reputation: 129

Shiny Dashboard boxes responsivity

I have two boxes in the first are two inputs and second box contains table. I use package DT for table. This setting is ok for resolution 1920x1080 but problem is in smaller resolution for example 1024x768

tabItem(tabName="Table",titlePanel("My Data"),


box(width=2,uiOutput("first_input"),textInput("numbers_input",label="choose your option",width ="200px")),

box(width=9,dataTableOutput("tabData"))

),

1024x768 enter image description here

Upvotes: 0

Views: 285

Answers (1)

Pork Chop
Pork Chop

Reputation: 29417

Try adding scrollX = T

library(shiny)
library(shinydashboard)
library(DT)

ui <- dashboardPage(
  dashboardHeader(), 
  dashboardSidebar(),
  dashboardBody(
    tabItem(tabName="Table",titlePanel("My Data"),
            box(width=2,uiOutput("first_input"),textInput("numbers_input",label="choose your option",width ="200px")),
            box(width=9,dataTableOutput("tabData"))

    )
  )
)

server <- function(input, output, session) {
  output$tabData <- renderDataTable({cbind(mtcars,mtcars)},options = list(scrollX = T))
}

shinyApp(ui, server)

Upvotes: 1

Related Questions