如何在 Shiny Dashboard 的框中居中 table
How to center table in box in Shiny Dashboard
我很难将我在 Shiny Dashboard 中制作的 table 放在一个盒子的中心。我使用了 .csv 文件,但这里有一些假数据:
Stage = c("Survey", "Work Sample", "Interview", "Stats Test")
Score = c("+33.7%", "+14.8%", "+20.8%", "+28.17%")
no1_cand = data.frame(Stage, Score)
Score =c("+37.1%", "+14.2%", "+19.3%", "+26.3%")
no2_cand = data.frame(Stage, Score)
Score = c("+33.1%", "+22.2%", "+17.3%", "+25.8%")
no3_cand = data.frame(Stage, Score)
Score = c("+29.1%", "+17.2%", "+15.3%", "+23.3%")
no4_cand = data.frame(Stage, Score)
Score = c("+22.1%", "+12.5%", "+11.4%", "+19.5%")
no5_cand = data.frame(Stage, Score)
以及我为 table 和盒子设置的当前代码:
#UI
box(title = "Top 5 Candidates",
status = "primary",
solidHeader = F,
collapsible = T,
width = 12,
fluidRow(
tableOutput('top5')))
#Server
output$top5 = renderTable({
top5_data
})
目前看起来是这样的:
尝试:
box(title = "Top 5 Candidates"
, status = "primary", solidHeader = F
, collapsible = T, width = 12
, column(12, align="center", tableOutput('top5')))
我很难将我在 Shiny Dashboard 中制作的 table 放在一个盒子的中心。我使用了 .csv 文件,但这里有一些假数据:
Stage = c("Survey", "Work Sample", "Interview", "Stats Test")
Score = c("+33.7%", "+14.8%", "+20.8%", "+28.17%")
no1_cand = data.frame(Stage, Score)
Score =c("+37.1%", "+14.2%", "+19.3%", "+26.3%")
no2_cand = data.frame(Stage, Score)
Score = c("+33.1%", "+22.2%", "+17.3%", "+25.8%")
no3_cand = data.frame(Stage, Score)
Score = c("+29.1%", "+17.2%", "+15.3%", "+23.3%")
no4_cand = data.frame(Stage, Score)
Score = c("+22.1%", "+12.5%", "+11.4%", "+19.5%")
no5_cand = data.frame(Stage, Score)
以及我为 table 和盒子设置的当前代码:
#UI
box(title = "Top 5 Candidates",
status = "primary",
solidHeader = F,
collapsible = T,
width = 12,
fluidRow(
tableOutput('top5')))
#Server
output$top5 = renderTable({
top5_data
})
目前看起来是这样的:
尝试:
box(title = "Top 5 Candidates"
, status = "primary", solidHeader = F
, collapsible = T, width = 12
, column(12, align="center", tableOutput('top5')))