表格不会排成一行

时间:2018-07-30 18:33:27

标签: shiny shinydashboard

我正在创建一个盒子,盒子里面有一张图片和3张桌子。全部显示在闪亮的仪表板上。

###Data 
Skill = c("Wood", "Metal", "Speech", "Garden","Design", "Stats", "Farming", "Tattoos")

Score = c("+33.7%", "+14.8%", "+20.8%", "+28.17%", "+12.9%", "+19.9%", "+27.3%", "+28.1%")
no1_A = data.frame(Skill, Score)
Score =c("+37.1%", "+14.2%", "+19.3%", "+26.3%", "+19.5%", "+11.8%", "+15.3%", "+26.2%")
no1_B = data.frame(Skill, Score)
Score = c("+3.1%", "+22.2%", "+17.3%", "+25.3%", "+11.5%", "+21.0%", "+14.6%", "+25.2%")
no1_C = data.frame(Skill, Score)


###UI
box(title = "",
    status = "primary",
    solidHeader = F,
    collapsible = F,
    width = 12,
    fluidRow(
      column(width=2, align="center",
             img(src="no1.jpeg", width=100)),
      column(width = 4,offset = 0, style='padding:0px;',
             box(title = "Table A",
                 div(tableOutput("no1_A")), style = "font-size:80%")),
      column(width = 4,offset = 0, style='padding:0px;',
             box(title = "Table B",
                 div(tableOutput("no1_B")),style = "font-size:80%" )),
      column(width = 4,offset = 0, style='padding:0px;',
             box(title = "Table C",
                 div(tableOutput("no1_C")), style = "font-size:80%"))
    ))


### Server
output$no1_A <-renderTable(no1_survey)
output$no1_B <-renderTable(no1_ws)
output$no1_C <-renderTable(no1_int)

我希望所有三个表都对齐成一行。我尝试更改字体的大小以使其变小,但是它无法正常工作,并且肯定有足够的空间来容纳所有3个连续的行+图像。

What it looks like

1 个答案:

答案 0 :(得分:1)

您行中的列宽度总计为14,如果最大则为12。将表格宽度分别减小到3,然后将其排序。