简体   繁体   English

闪亮的HTML元素和DT :: renderDataTable输出

[英]Shiny HTML Element and DT::renderDataTable output$

My webpage is done in HTML and connected to Shiny via simple output$ matching IDs of HTML Elements. 我的网页以HTML格式完成,并通过HTML元素的简单output $匹配ID连接到Shiny。

To represent table data on the webpage the code below works fine: 为了表示网页上的表格数据,以下代码可以正常工作:

server.R 服务器

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

index.html index.html

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

Now my question... 现在我的问题...

How does this work for DataTable? 这对DataTable如何起作用?

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

index.html index.html

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

How does the div look like? div看起来如何? I found datatables, which did not work. 我发现数据表不起作用。

Thanks for your help! 谢谢你的帮助!

Run the app from the console and inspect in browser. 从控制台运行该应用程序,然后在浏览器中进行检查。 This is what came up for me with a datatable with default attributes: 这是什么来弥补我一个datatable默认属性:

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

You need to add the script: 您需要添加脚本:

' <script src="datatables-binding-0.5/datatables.js"></script> ' ' <script src="datatables-binding-0.5/datatables.js"></script> '

and the div class for the renderDataTable is datatables html-widget html-widget-output 而renderDataTable的div类是datatables html-widget html-widget-output

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM