How to make the horizontal scrollbar visible in DT::datatable

前端 未结 3 971
庸人自扰
庸人自扰 2021-01-01 10:51

Using R shiny & DT package, I am creating certain tables. The number of columns vary as per user input & is not fixed. I have included the following code snippet to

3条回答
  •  没有蜡笔的小新
    2021-01-01 11:05

    I would have done this way also:

    datasetInput1 <- reactive({
          infile <- input$file1
          if(is.null(infile))
            return(NULL) 
          else
            m <- read.csv(infile$datapath, header = input$header)
            return ( DT::datatable(m, extensions = 'Scroller', options = list(deferRender = F, dom = 't',
                                                                          columnDefs = list(list(className = 'dt-center',
                                                                                                 targets = 5)),
                                                                         scrollY = 300, scroller = TRUE, scrollX = T,
                                                                         pageLength = 5))
                   )
        })
    

提交回复
热议问题