Does anyone know if there are issues using the DT package in conjunction with knitrBootstap? When I try to render a data table using the datatable
function, the table itself does not render when the document is knit.
I've tried using the simple example below in both a standard markdown document as well as the knitrBootstrap styled document. It prints in the standard HTML output, but not in the bootstrap styled document:
library(DT)
datatable(iris)
Any thoughts on what might be causing this or how to workaround this? I've tried altering a few chunk options including results='asis
, but it didn't seem to help.
I am able to workaround this by using kable, setting an id and then utilizing javascript outside of the markdown chunk to render the table
kable(value_test, "html", table.attr = "id=\"test_table\"")
followed by:
<script type="text/javascript">
$(document).ready(function() {
$('#test_table').DataTable();
} );