I have a problem with text in Shiny Dashboard. I would like to save original text formatting, but shiny removes the whitespaces I want to keep.
output$frame <- renderUI({
HTML(paste(
p(strong("Name and Surname:"),(" John Smith"))
)
)
})
tabItem(tabName = "aaa",
h2("bbb"),
fluidRow(
box(width = 6, solidHeader = TRUE, htmlOutput("frame"))
)
),
Unfortunately I get "Name and Surname: John Smith".
I wish to have "Name and Surname: John Smith"
.
How to solve this problem?
You can use HTML(' ')
to add 1 whitespace and HTML(' ')
to add 1 tab space. In your code it wold be as follows:
output$frame <- renderUI({
HTML(paste(
p(strong("Name and Surname:"), HTML(' '),HTML(' '),"John Smith")
)
)
})
With this you get two white spaces and output looks like this:
I found that we can also use stri_dup(intToUtf8(160), 6)
from package stringi
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With