【问题标题】:Column Filters Not Visible Using Datatable Shiny使用 Datatable Shiny 不可见列过滤器
【发布时间】:2019-07-26 07:14:05
【问题描述】:

我从 DT 包中创建了一个超过 50 行的数据表。由于这个原因,顶部的过滤器框不是很大。它们似乎在过滤器框中有很多未使用的空白。有没有办法减少这种情况,所以我至少可以看到部分过滤器?我将使用 iris 数据集向您展示我希望看到的情况与我目前拥有的情况。

ui.R
...
 fluidRow(
            column(
                    width = 12,
                    box(width = NULL, status = "info", solidHeader = T, title = "Earnings Scanner",

                     DTOutput("tab"),style = "height:700px; overflow-y: scroll;overflow-x: scroll;font-size:70%;"
                    )
                  )
                )



server.R
...
output$tab = renderDT(
      datatable(
      frame.ea, filter = 'top', options = list(
        pageLength = 10, autoWidth = TRUE), class = 'cell-border stripe', rownames = F)
    ) 

使用 Iris 数据集,您可以看到我想要实现的目标

【问题讨论】:

    标签: javascript html r shiny datatables


    【解决方案1】:

    这似乎是您的桌子宽度的问题。 (请下次提供可重现的示例)

    所以我将使用style fomr DTOutput 中的width 值:

    ui.R ...  fluidRow(
                column(
                        width = 12,
                        box(width = NULL, status = "info", solidHeader = T, title = "Earnings Scanner",
    
                         DTOutput("tab"),style = "height:700px; width:700px; overflow-y: scroll;overflow-x: scroll;font-size:70%;"
                        )
                      )
                    )
    
    
    
    server.R ... output$tab = renderDT(
          datatable(
          frame.ea, filter = 'top', options = list(
            pageLength = 10, autoWidth = TRUE), class = 'cell-border stripe', rownames = F)
        )
    

    【讨论】:

      猜你喜欢
      • 2020-03-02
      • 2019-09-14
      • 2019-03-22
      • 2011-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-27
      相关资源
      最近更新 更多