I am trying to create a Shiny app with some text boxes. I like that the verbatimTextOutput has a box around the text, but with slightly longer text, the words get broken in meaningless places in order to wrap the text. Is there some way that I can stop the words from being split? A very simple example is below.
ui <- fluidPage(
fluidRow(column(3, offset=0, verbatimTextOutput("TxtOut")))
)
server <- function(input, output, session) {
output$TxtOut <- renderText(
"a longish text that goes over multiple lines and breaks words"
)
}
shinyApp(ui = ui, server = server)
Because
column
width is set to3
, your text is wrapping in the output function. As explained in the comments above, followingstyle
will prevent wrapping, and add a scroll bar to navigate.