Skip to content

Instantly share code, notes, and snippets.

@cecilialee
Created February 24, 2018 03:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecilialee/2237f9114796b24d4f9526ff0bdaf19f to your computer and use it in GitHub Desktop.
Save cecilialee/2237f9114796b24d4f9526ff0bdaf19f to your computer and use it in GitHub Desktop.
Render string in multiple lines using HTML in Shiny. #r #shiny
library(shiny)
ui = basicPage(
textInput("txt1", "Input the first string"),
textInput("txt2", "Input the second string"),
uiOutput("cat_str")
)
server = function(input, output) {
output$cat_str <- renderUI({
HTML(paste(input$txt1, input$txt2, sep = "<br/>"))
})
}
shinyApp(ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment