diff --git a/R/shiny.R b/R/shiny.R index 580b24529..660214f99 100644 --- a/R/shiny.R +++ b/R/shiny.R @@ -38,10 +38,15 @@ ShinyApp <- setRefClass( return(paste("data:image/png;base64,", b64, sep='')) }) }, - define.table.output = function(name, func) { + define.table.output = function(name, func, ...) { .outputs$set(name, function() { data <- func() - return(paste(capture.output(print(xtable(data), type='html')), collapse="\n")) + return(paste( + capture.output( + print(xtable(data, ...), + type='html', + html.table.attributes='class="data"')), + collapse="\n")) }) }, instantiate.outputs = function() { @@ -147,8 +152,8 @@ start.app <- function(app, www.root, sys.www.root=NULL, port=8101L) { define.shiny.plot <- function(name, func, ...) { shinyapp$define.plot.output(name, func, ...) } - define.shiny.table <- function(name, func) { - shinyapp$define.table.output(name, func) + define.shiny.table <- function(name, func, ...) { + shinyapp$define.table.output(name, func, ...) } get.shiny.input <- function(name) { shinyapp$session$get(name) diff --git a/examples/03_distributions/www/index.html b/examples/03_distributions/www/index.html index 39b76c530..d14be5ab3 100644 --- a/examples/03_distributions/www/index.html +++ b/examples/03_distributions/www/index.html @@ -19,7 +19,7 @@
-
+