css - 无法让 Shiny App 中的 Navbar 看起来正常

标签 css r twitter-bootstrap shiny

在我的应用程序中,我使用了导航栏。我尝试了 Bootswatch.com 的所有免费 CSS Bootstrap 样式表(甚至修改了它们),但我总是这样结束:

enter image description here

标题是“Instagram 分析器”。第一个菜单项在同一行中,第二个菜单项在其下方移动一行。谁能找出 CSS 代码的哪一部分产生了那个“错误”?

在这张照片中,我使用了“Amelia”风格。

这里是 ui.R 代码:

shinyUI(navbarPage("Instagram Analyzer",
               tabPanel("One User at a Glance",
                        fluidRow( column(width = 12,h1("Instagram Analyzer"))  
                        ),
                        fluidRow( column(width = 4,selectInput("user",label="Instagram User",choices=data)), 
                                  column(width = 8,tableOutput("basics"),tableOutput("z")) 
                        ),
                        fluidRow( column(width = 12,plotOutput("plot"))
                        )
               ),
               tabPanel("Manage Database"),theme="instagram.css"
))

在这里您可以找到样式表: http://bootswatch.com/amelia/

最佳答案

第一个 tabPanel 中的 fluidRow 等需要在容器中:

library(shiny)
runApp(list(ui = 
              navbarPage("Instagram Analyzer",
                         tabPanel("One User at a Glance",
                                  fluidPage(
                                    fluidRow( column(width = 12,h1("Instagram Analyzer"))),
                                    fluidRow( column(width = 4, selectInput("user", label="Instagram User", choices = c(LETTERS[1:4]))), 
                                              column(width = 8, tableOutput("basics"), tableOutput("z")) 
                                    ),
                                    fluidRow( column(width = 12, plotOutput("plot")))
                                  )
                         )
                         , tabPanel("Manage Database")
              )
            , server = function(input, output, session){

            })
)

enter image description here

关于css - 无法让 Shiny App 中的 Navbar 看起来正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25241162/

相关文章:

jquery - 带有 Bootstrap 类的固定标题 html 表

r - spanm参数在geom_smooth中控制什么?

r - 在 for 循环中计算 p 值

jquery - 通过 JS 获取当前事件标签。

javascript - 平滑折叠侧边栏

javascript - 使用 jQuery 和 reddit API,尝试为每个帖子创建单独的 div

css - 我可以组合 :nth-child() or :nth-of-type() with an arbitrary selector?

css - 在 Twitter Bootstrap 的导航栏下方启动背景图片

python - R和Python的cov和cor的区别

javascript - Twitter Bootstrap 上非事件选项卡内的模式