I'm using a shiny presentation in order to display two tables. Here's my code:
tabsetPanel(
tabPanel('iris',
renderDataTable(iris,options =
list(lengthMenu = c(5, 10), pageLength = 5, scrollX = TRUE), escape =
FALSE)),
tabPanel('mtcars',
renderDataTable(mtcars, options = list(lengthMenu
= c(5, 10), pageLength = 5, scrollX = TRUE), escape = FALSE))
)
I would like to shrink the size of the tables. I tried adding div in the following way:
div(renderDataTable(mtcars, options = list(lengthMenu
= c(5, 10), pageLength = 5, scrollX = TRUE), escape = FALSE), style = "font-
size:50% ")
But this is not working.
I also tried doing this:
mainPanel(
tabsetPanel(id='BLMS',
tabPanel("iris", fluidRow(div(dataTableOutput(outputId="iris"),
style = "font-size:50%"))),
tabPanel("mtcars",
fluidRow(div(dataTableOutput(outputId="mtcars"), style = "font-size:50%")))
)
)
output$iris<- renderDataTable({iris}, options = list(lengthMenu = c(5, 10),
pageLength = 5, scrollX = TRUE))
output$mtcars<- renderDataTable({mtcars},options = list(lengthMenu = c(5,
10), pageLength = 5, scrollX = TRUE))
But It's displaying a table cut in half in the presentation.