【问题标题】:How to vertically offset a wellPanel from the very top?如何从最顶部垂直偏移wellPanel?
【发布时间】:2017-10-04 20:48:48
【问题描述】:

我在 wellPanel 中有一个只有一行和一列的布局。我的目标是垂直偏移这个面板。目前它被“粘”在最顶部,但应该向下移动几厘米。

library(shiny)

ui <- fluidPage(
  wellPanel(fluidRow(column(width = 11, align = "center", h3("I need to move south!")))))

server <- function(input, output) {}

shinyApp(ui = ui, server = server)

【问题讨论】:

  • 您可以添加br(),在wellPanel()之上添加新行...
  • 好的,这是一个妥协。不过,我更喜欢更灵活的东西。

标签: r shiny offset


【解决方案1】:

您可以将wellPanel() 包装在absolutePanel()

library(shiny)
ui <- fluidPage(
   absolutePanel(top = "50%", left = 20, width = "97.5%", 
            wellPanel(
              fluidRow(
                column(
                  width = 12,
                  align = "center", h3("I am at the centre!")
                )
              )
            )
 )
)

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多