我有两个盒子,第一个是两个输入,第二个盒子包含表格。我使用包DT表。此设置适用于分辨率1920x1080,但问题是分辨率较小,例如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"))
),
答案 0 :(得分:1)
尝试添加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)