whitespace in R Shiny

前端 未结 3 1138
暖寄归人
暖寄归人 2021-01-21 04:23

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 <         


        
3条回答
  •  执笔经年
    2021-01-21 05:11

    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:

提交回复
热议问题