【问题标题】:Shiny HTML Element and DT::renderDataTable output$闪亮的 HTML 元素和 DT::renderDataTable 输出$
【发布时间】:2017-05-25 08:12:22
【问题描述】:

我的网页是用 HTML 完成的,并通过简单的 output$ 匹配 HTML 元素的 ID 连接到 Shiny。

为了在网页上表示表格数据,下面的代码可以正常工作:

server.R

output$InfoTable <- renderTable({...})

index.html

<div id="InfoTable " class="shiny-html-output"></div>

现在我的问题...

这对 DataTable 有何作用?

output$InfoDataTable <- DT::renderDataTable({...})

index.html

<div id="InfoDataTable" class="???"></div>

div 长什么样子? 我找到了数据表,但它不起作用。

感谢您的帮助!

【问题讨论】:

    标签: html r class shiny dt


    【解决方案1】:

    从控制台运行应用程序并在浏览器中检查。这就是我想出的带有默认属性的datatable

    class="datatables html-widget html-widget-output shiny-bound-output"
    

    【讨论】:

    • 感谢万斯,这也是我尝试过并再次尝试的方法。不幸的是,这对我不起作用。
    【解决方案2】:

    你需要添加脚本:

    '&lt;script src="datatables-binding-0.5/datatables.js"&gt;&lt;/script&gt;'

    renderDataTable 的 div 类是 datatables html-widget html-widget-output

    【讨论】:

      猜你喜欢
      • 2020-09-18
      • 2016-01-02
      • 2017-05-05
      • 1970-01-01
      • 2019-05-03
      • 2014-02-28
      • 2018-05-02
      • 1970-01-01
      • 2021-11-21
      相关资源
      最近更新 更多