Css 如何自定义多个fillCol的宽度?

Css 如何自定义多个fillCol的宽度?,css,r,shiny,Css,R,Shiny,我正在寻找一种在UI中自定义fillCol宽度的方法。我想将侧边栏1的宽度设置为20%,Main设置为60%,侧边栏2设置为20%。我尝试使用%CSS单元,但没有成功 library(shiny) ui <- fillPage( fillRow( tags$b("Header"), height = "5vh"), fillRow( fillCol(tags$

我正在寻找一种在UI中自定义
fillCol
宽度的方法。我想将侧边栏1的宽度设置为20%,Main设置为60%,侧边栏2设置为20%。我尝试使用
%
CSS单元,但没有成功

library(shiny)

ui <- fillPage(
   
    fillRow(
            tags$b("Header"), 
            height = "5vh"),
    fillRow(
        fillCol(tags$b("Sidebar1"), width = "10%"),
        fillCol(tags$b("Main"), width = "80%"),
        fillCol(tags$b("Sidebar2"), width = "10%"),
           
            height = "90vh"),
    fillRow(
        tags$b("Footer"), 
        height = "5vh"))
    

server <- function(input, output, session) {
    
}

shinyApp(ui, server)
库(闪亮)

ui您应该使用flex=c(1,3,1)
获得20%、60%和20%的显示,如下所示

ui <- fillPage(
  
  fillRow(
    tags$b("Header"), height = "5vh"),
  fillRow(flex = c(1,3,1),
    plotOutput("plotLeft",  height = "50%"),
    plotOutput("plotMiddle", height = "50%"),
    plotOutput("plotRight",  height = "50%") , height = "90vh"
    ),
  fillRow(
    tags$b("Footer"), 
    height = "5vh"))


server <- function(input, output, session) {
  output$plotLeft <- renderPlot(plot(cars))
  output$plotMiddle <- renderPlot(plot(pressure))
  output$plotRight <- renderPlot(plot(AirPassengers))
}

shinyApp(ui, server)

ui您应该使用
flex=c(1,3,1)
获得20%、60%和20%的显示,如下所示

ui <- fillPage(
  
  fillRow(
    tags$b("Header"), height = "5vh"),
  fillRow(flex = c(1,3,1),
    plotOutput("plotLeft",  height = "50%"),
    plotOutput("plotMiddle", height = "50%"),
    plotOutput("plotRight",  height = "50%") , height = "90vh"
    ),
  fillRow(
    tags$b("Footer"), 
    height = "5vh"))


server <- function(input, output, session) {
  output$plotLeft <- renderPlot(plot(cars))
  output$plotMiddle <- renderPlot(plot(pressure))
  output$plotRight <- renderPlot(plot(AirPassengers))
}

shinyApp(ui, server)
ui