R语言 使导航列表面板变高

km0tfn4u  于 2023-02-06  发布在  其他
关注(0)|答案(1)|浏览(175)

下面是导航列表面板的一个简单示例:

library(shiny)

ui <-  fluidPage(
titlePanel("Navlist panel example"),

    navlistPanel(
      "Header",
      tabPanel("First",
               h3("This is the first panel")),
      tabPanel("Second",
               h3("This is the second panel")),
      tabPanel("Third",
               h3("This is the third panel"))
    )

)

server <- function(input, output) {
}

shinyApp(ui, server)

我需要井(又名灰色矩形圆角,是周围的导航列表)更高,并扩大到采取由红色矩形标记的白色:
Image
navlistPanel()函数中没有参数来执行此操作(只有width参数)

z3yyvxxp

z3yyvxxp1#

我将按照如下方式进行操作,添加一个style标记并向.row元素添加自定义高度。

library(shiny)

ui <-  fluidPage(
  titlePanel("Navlist panel example"),
  tags$style(".row{height: 500px;} .row div:nth-child(1){height: 100%;}"),
  
  navlistPanel(
    "Header",
    tabPanel("First",
             h3("This is the first panel")),
    tabPanel("Second",
             h3("This is the second panel")),
    tabPanel("Third",
             h3("This is the third panel"))
  )
  
)

server <- function(input, output) {
}

shinyApp(ui, server)

PS:请注意,您的应用程序中可以有多行

相关问题