View source: R/RmarkdownFunctions.R
DataTable | R Documentation |
Fully loaded DT::datatable() with args prefilled
DataTable(data, FixedCols = 2)
data |
source data.table |
FixedCols |
Number of columns from the left to Freeze, like freeze panes in Excel. Default is 2 |
Adrian Antico
Other Shiny:
DataTable2()
## Not run:
# Rmarkdown example of DataTable inside a <details> </Details> section
```{r Get Dependencies For DT::datatable(), echo=FALSE,include = FALSE}
# You need this code to conduct the magic dependences attaching...
DT::datatable(matrix())
```
```{js Nest All DT::datatable() inside a details drop down, echo=FALSE}
setTimeout(function() {
var codes = document.querySelectorAll('.dataTables_wrapper');
var code, i, d, s, p;
for (i = 0; i < codes.length; i++) {
code = codes[i];
p = code.parentNode;
d = document.createElement('details');
s = document.createElement('summary');
s.innerText = 'Details';
// <details><summary>Details</summary></details>
d.appendChild(s);
// move the code into <details>
p.replaceChild(d, code);
d.appendChild(code);
}
});
```
```{r Example, echo = FALSE}
AutoQuant::DataTable(data)
````
# Shiny Usage
output$Table <- shiny::renderUI({AutoQuant::DataTable(data)})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.