我如何从表中的折行DT :: datatable

时间:2019-08-12 13:53:23

标签: r r-markdown dt

如果行单元格中的行很长,如何确定DT::datatable不会中断该行?

代码示例:

---                                                                                                                                                                                                                   
title: "Example SO"                                                                                                                                                                                                   
output:                                                                                                                                                                                                               
  html_document:                                                                                                                                                                                                      
    toc: true                                                                                                                                                                                                         
    number_sections: true                                                                                                                                                                                             
    code_folding: "hide"                                                                                                                                                                                              
    toc_float:                                                                                                                                                                                                        
      collapse: false                                                                                                                                                                                                 
      smooth_scroll: false                                                                                                                                                                                            
---                                                                                                                                                                                                                   

```{r setup, echo=FALSE}                                                                                                                                                                                              
knitr::opts_chunk$set(error = TRUE,                                                                                                                                                                                   
                      echo = TRUE,                                                                                                                                                                                    
                      message = FALSE,                                                                                                                                                                                
                      comment = "",                                                                                                                                                                                   
                      fig.align = "left"                                                                                                                                                                              
                      )                                                                                                                                                                                               
```                                                                                                                                                                                                                   

# H1 Stuff                                                                                                                                                                                                            

```{r, DT}                                                                                                                                                                                                            
    DF <- data.frame(x = "A", y = "a crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy crazy long line that I would still be able to see")
    DT::datatable(DF, rownames = FALSE, options = list(pageLength = 2))                                                                                                                                               
```                                                                                                                                                                                                                   

# H2 More stuff                                                                                                                                                                                                       
Bla

输出:

enter image description here

0 个答案:

没有答案