JRF1111
JRF1111

Reputation: 182

DT::datatable won't render results in HTML R markdown report

I have an HTML R markdown template that I've been using for a while to render reports. I mainly use DT::datatable() to report the results in the markdown report so I can use the copy button extension to copy the results into another document for final processing/formatting. Up until about a week ago, this was working fine. However now, my markdown report will only render the first table printed with DT::datatable() in the report.

I dived down into the raw HTML of the report and found that the first table renders as expected:

HTML of first table

However, when I look at where the second table is supposed to be, the table doesn't appear to be getting rendered properly: HTML of second table

Even if I just use DT::datatable() with the default options, it won't render: HTML of third table

The complete markdown document and the rendered report are at https://github.com/jrf1111/July13_SO_issue

Upvotes: 1

Views: 1459

Answers (1)

JRF1111
JRF1111

Reputation: 182

I figured out the issue. In my first call to DT::datatable I used DOM = 'B' to enable buttons, but I didn't include t. For some reason that allowed the first datatable to render properly but prevented any further calls to DT::datatable from rendering. Setting DOM = 'Bt' in the first call to DT::datatable fixed everything.

Upvotes: 1

Related Questions