I may be using the term "responsive" incorrectly in this context but I am trying to create a table using DT::datatable in blogdown/Hugo where the container adjusts to the "Show entries" selection, like the first table on the DT page. I am able to do this in a regular html document using knitr/R markdown but cannot get this behavior in blogdown. My understanding is that to have an html widget in blogdown (with Hugo) I need to use widgetframe package. Cool. The widgetframe documentation has a demonstration with the DT package here (bottom of page) . As you can see though, when you adjust the "Show entries" the container stays the same.
A minimal example for straight-up R Markdown/knitr html document where the container responds to "Show entries".
library(DT)
datatable(iris)
A minimal example using widgetframe in blogdown where the container does not respond to "Show entries".
library(widgetframe)
library(DT)
dt <- datatable(
head(iris, 20),
options = list(
columnDefs = list(list(className = 'dt-center', targets = 5)),
pageLength = 5, lengthMenu = c(5, 10, 15, 20)),
fillContainer = T)
frameWidget(dt, height = 350, width = '95%')
I have tried manually controlling the height in both the frameWidget and DT commands. I can control the container size but cannot get it to respond to the number of "Show entries". Thanks