假设我有以下 Shiny UI 代码:
fluidRow(
column(
width=4
),
column(
width=8
)
)
我该如何绘制第一列的右边框?
您可以使用style
参数将CSS添加到列中。因此,一种方法是:
library(shiny)
ui <- fluidPage(
fluidRow(
column(style='border-right: 1px solid red',
width=4,
p('Hello')
),
column(
width=8,
p('World')
)
)
)
server <- function(input,output) {}
shinyApp(ui,server)
希望这能帮到你!
library(shiny)
ui <- fluidPage(
tags$head(
tags$style(HTML("
.column_w_bar {
border-right-color: #eb4034;
border-right-width: 1px;
border-right-style: solid;
}
") # end HTML
) # end tags$style
) # end tags$head
fluidRow(
column(class = 'column_w_bar',
width=4
),
column(
width=8
)
) # end fluidRow
) # end FluidPage
tags$head()
和tags$style()
。您也可以在闪亮项目的“www”文件夹中创建单独的.css文件中的样式。