knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Tables with DT::datatable()
are not rendering correctly in pkgdown.
Here's a bunch of different things I've tried.
Currently DT tables fill the entire container, but the internal columns do not.
library(DT) datatable(iris)
Adding filter
fixes the column width issue. Would be nice if columns widths were fixed without this.
Issue filed at https://github.com/rstudio/DT/issues/563.
Hint from from https://saurfang.github.io/pkgdown.example/reference/datatable.html
datatable(iris, filter = 'top')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.