@dthomas - So I think I mostly figured this out. It seems like the problem is that the dfSummary() has it's own CSS which overrides the default CSS in shiny when it is called. To prevent this from happening I examined the object returned by dfSummary(), manually pulled out the "important" CSS and then returned only the HTML from that object. For example:
out <- print(dfSummary(mtcars), omit.headings = TRUE, method = 'render')
out[[3]][[2]][[1]]
returns the necessary HTML that can be rendered in shiny.
out <- print(dfSummary(mtcars), omit.headings = TRUE, method = 'render')
out[[3]][[1]][[3]][[3]]
returns the CSS.
If you copy that CSS and put it into a separate file (e.g. dfSummary.css) in a www/ directory you can then load it into your application.
From a high level this would look like:
ui <- fluidPage(theme = "dfSummary.css",
fluidRow(
uiOutput("summaryTable")
)
)
server <- function(input, output, session) {
output$summaryTable <- renderUI({
out <- print(dfSummary(mtcars), omit.headings = TRUE, method = 'render')
out[[3]][[2]][[1]]
})
}
shinyApp(ui, server)
where dfSummary.css is the CSS copied from above.
Let me know if this helps.
Matt