| a11y_renderDataTable | R Documentation |
A wrapper for DT::renderDataTable() that enables keyboard navigation
(KeyTable extension) by default and provides built-in German/English
translations.
a11y_renderDataTable(expr, lang = NULL, dt_language = NULL, ...)
expr |
Table expression |
lang |
Language code ( |
dt_language |
(optional) DT language list (see DT docs); required when
using a language other than |
... |
Other |
A Shiny render function
# Inside a Shiny server function
if (interactive()) {
library(shiny)
server <- function(input, output, session) {
output$table <- a11y_renderDataTable(
expr = mtcars[, 1:5],
lang = "en"
)
}
}
# German-language table with Buttons extension and accessible export options
if (interactive()) {
library(shiny)
server <- function(input, output, session) {
output$table_de <- a11y_renderDataTable(
expr = head(iris[, 1:4], 10),
lang = "de",
selection = "none",
extensions = c("Buttons"),
options = list(
pageLength = 5,
dom = "Bfrtip",
buttons = c("excel", "csv")
)
)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.