I want to add a break line in one choice because it is too long. There is a similar question for the label of a button but the solution does not work for me, see the following code
ui <- fluidPage(
splitLayout(cellWidths = c(170,80,160),
tagList(uiOutput("example")))
)
server <- function(input, output) {
choices_vector <- c("choice 1","choice 2",HTML("I want a line break here <br/> since the label is too long"),"choice 4")
output$example <- renderUI({
checkboxGroupInput(inputId = "choices_selec",
label = "", choices = choices_vector, selected = F)
})
}
# Run the application
shinyApp(ui = ui, server = server)
I also tried using using paste0 and collapse (see the following code) and changing uiOutput for htmlOutput but the results are the same
server <- function(input, output) {
choices_vector <- c("choice 1","choice 2",paste0(c("I want a line break here ", "since the label is too long"), collapse = "<p/>"),"choice 4")
output$example <- renderUI({
checkboxGroupInput(inputId = "choices_selec",
label = "", choices = choices_vector, selected = F)
})
}
Any help would be appreciated, thanks!
