【问题标题】:R Shiny: center an absolutePanelR Shiny:将absolutePanel居中
【发布时间】:2017-01-30 09:44:17
【问题描述】:

如何在 Shiny 中将 absolutePanel 居中?我尝试设置 left = 50% 并将面板左侧居中。

absolutePanel(id = "myId", class = "myClass", fixed = TRUE
                    ,draggable = TRUE, top = 10, left = "50%", right = "auto", bottom = "auto"
                    ,width = 100, height = "auto"

【问题讨论】:

  • 您想在面板内部居中吗?如果是这样,请尝试left="50%", style="text-align: center;"
  • 它在这样的 div 中:fluidPage(absolutePanel(div(absolutePanel(id = "myId"... '我希望使面板在整个页面上居中。

标签: r shiny


【解决方案1】:

我认为你应该把css文件放在里面:

#myId{margin: auto;}

【讨论】:

    【解决方案2】:

    经过一些实验,这很有效。 absolutePanel 内部(在 ui.R 中)设置

    absolutePanel(id = "myId", class = "myClass", fixed = TRUE
                    ,draggable = TRUE, top = 0, left = 0, right = 0, bottom = 0
                    ,width = 100, height = "auto", ...
    

    然后在一个css文件集合中

    #myId { 
      margin: auto;
    }
    

    【讨论】:

      猜你喜欢
      • 2020-07-15
      • 2017-06-27
      • 2020-04-01
      • 2019-05-04
      • 1970-01-01
      • 2019-01-22
      • 2010-12-03
      • 2014-09-28
      • 2019-01-28
      相关资源
      最近更新 更多