Reputation: 2690
Building a Shiny Dashboard where I need to render a matrix.
For that I plan to use a DT::renderDataTable
.
Everything is inside a FluidRow with a column size of 3 (out of 12). The DataTable spread out of the defined column.
How can I force the table to fit the column and don't go over it ?
Upvotes: 1
Views: 230
Reputation: 21287
Perhaps you can use splitLayout
to obtain your desired output. Try this
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "Test App"
),
dashboardSidebar(),
dashboardBody(
splitLayout(cellWidths = c("25%", "25%", "50%"),
DTOutput("t1"), DTOutput("t2"), DTOutput("t3")
)
)
)
server <- function(input, output) {
output$t1 <- renderDT({mtcars})
output$t2 <- renderDT({mtcars[9:15,]})
output$t3 <- renderDT({mtcars[21:32,]})
}
shinyApp(ui, server)
Upvotes: 2