markdown 将内容固定到屏幕宽度

问题描述 投票:0回答:1

我有这个应用程序:

ui <- fluidPage(
  uiOutput("preview")
)

server <- function(input, output, session) {
  
  deployExeList<-function(){
    return(
      list(splitLayout(
        id=paste0("slexe")
        ,shiny::div(class = "",style = "width: 100%;",
                    shiny::withMathJax(
                      shiny::HTML(
                        markdown::markdownToHTML(text = "### **aaa/bbbb: ccc000.**\n### In recent years, automatic analyses using novel NLP methods have been used to investigate language abnormalities in schizophrenia. In contrast, only a few studies used automated language analyses in bipolar disorder. To our knowledge, no previous research compared automated language characteristics of first-episode psychosis (FEP) and bipolar disorder (FEBD) using NLP methods"
                                                 ,fragment.only = TRUE)
                      )
                    )
        ) 
      )
      )
    )
  }
  
  output[["preview"]]<-renderUI({deployExeList()})
  
}

shinyApp(ui = ui, server = server)

如何将内容固定到屏幕宽度?我的意思是,我想阻止水平滚动条:

enter image description here

r shiny markdown
1个回答
0
投票

white-space: normal;
分配给您的
div
:

library(shiny)

ui <- fluidPage(uiOutput("preview"))

server <- function(input, output, session) {
  deployExeList <- function() {
    return(list(splitLayout(
      id = paste0("slexe")
      ,
      shiny::div(
        class = "",
        style = "white-space: normal;",
        shiny::withMathJax(shiny::HTML(
          markdown::markdownToHTML(text = "### **aaa/bbbb: ccc000.**\n### In recent years, automatic analyses using novel NLP methods have been used to investigate language abnormalities in schizophrenia. In contrast, only a few studies used automated language analyses in bipolar disorder. To our knowledge, no previous research compared automated language characteristics of first-episode psychosis (FEP) and bipolar disorder (FEBD) using NLP methods"
                                   , fragment.only = TRUE)
        ))
      )
    )))
  }
  
  output[["preview"]] <- renderUI({
    deployExeList()
  })
}

shinyApp(ui = ui, server = server)

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.