whitespace in R Shiny

前端 未结 3 1169
暖寄归人
暖寄归人 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:24

    I found this oddly difficult to achieve. Just adding the style element to pre-wrap introduced an extra new line:

    p(strong("Name and Surname:"),("     John Smith"),style="white-space: pre-wrap")
    

    No other style elements (margin:0, etc) could fix this...so,to get around it, I just converted your strong() to HTML, and it works great:

    p(HTML("Name and Surname:         John Smith"),style="white-space: pre-wrap")
    

提交回复
热议问题