--- title: "Simple DataTables" --- Add the CSS/JS assets from the [simple-datatables](https://github.com/fiduswriter/simple-datatables/) library: ```{r} litedown::vest(css = '@npm/simple-datatables/dist/style', js = '@npm/simple-datatables') ``` There are two ways to render a table using the library. You can either pass the data as a JSON object: ```{js, type = 'module', fill = xfun::tojson} new simpleDatatables.DataTable('#table-iris', { data: { headings: `{ names(iris) }`, data: `{ unname(iris)[1:20, ] }` }, perPage: 5 }); ```