R Shiny:以绝对面板为中心

时间:2016-09-22 00:27:22

标签: r shiny

如何将一个绝对面板置于Shiny的中心?我尝试过设置左= 50%并将其放在面板的左侧。

Option Explicit
Private WithEvents ExcelApp As Excel.Application

Private Sub ExcelApp_NewWorkbook(ByVal Wb As Workbook)
    If Wb.Name = "MyWorkbook.xlsm" Then Call ProcessMyWorkbook
End Sub

Private Sub Workbook_Open()
    Set ExcelApp = Application
End Sub

2 个答案:

答案 0 :(得分:0)

经过一些实验,这很有效。在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;
}

答案 1 :(得分:0)

我认为你应该把它放在css文件中:

#myId{margin: auto;}