使选定InputIn R的第一个元素以粗体显示第一个、粗体、素以、InputIn

2023-09-03 14:08:02 作者:我们一起萌萌哒

我希望将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)

推荐答案

jQuery input 选择器选取表单元素

您可以按照@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)

输出将如下所示:

 
精彩推荐
图片推荐