R Shiny大小调整框

3

我的问题是,我告诉shiny使用整行(12列)来打印c7框,但它只使用了一半。有人能弄清楚问题在哪里吗?下面是我的代码:

 library(shinydashboard)
 library(shiny)
 library(readr)
 library(rsconnect)
 header=dashboardHeader(title="App")
 sidebar=dashboardSidebar(sidebarMenu(
 menuItem("Stack", tabName = "a", icon = icon("dashboard"))))
 c7=column(12,box(title="Prediction Box",status="warning",solidHeader=FALSE,
            textInput("text", label = h3("Write something :"), value = ""),actionButton("do","Go")))
 body=dashboardBody(tabItems(tabItem(tabName="a",fluidRow(c7))))
 ui <- dashboardPage(header,sidebar,body)

 server <- function(input, output){
 }
shinyApp(ui,server) 
1个回答

6

默认情况下,如果您没有指定 box 的宽度,它将被设置为 6。请查看 ?box

例如:enter image description here

library(shinydashboard)
library(shiny)

header=dashboardHeader(title="App")
sidebar=dashboardSidebar(sidebarMenu(menuItem("Stack", tabName = "a", icon = icon("dashboard"))))

?box
c7=column(12,box(width=12,title="Prediction Box",status="warning",solidHeader=FALSE,
                 textInput("text", label = h3("Write something :"), value = ""),actionButton("do","Go")))


body=dashboardBody(tabItems(tabItem(tabName="a",fluidRow(c7))))
ui <- dashboardPage(header,sidebar,body)

server <- function(input, output){
}
shinyApp(ui,server) 

enter image description here


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接