使选定InputIn R的第一个元素以粗体显示
我希望将selectInput的第一个元素"1"设置为粗体。请帮帮忙。
ui <- fluidPage(
selectInput(
"select",
label = h3("Select box"),
choices = c(1,2,3,4)
))
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)
解决方案
您可以按照@Nitin Shinde的建议在您闪亮的应用程序中添加样式,如下所示:
ui <- fluidPage(
tags$head(tags$style(".option:first-child{
font-weight:bold;
//color:#ff0000;
}")),
selectInput(
"select",
label = h3("Select box"),
choices = c(1,2,3,4)
))
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)
输出将如下所示:
相关文章