添加一些注释时,嵌套列正在改变形状

时间:2017-05-17 18:20:25

标签: shiny

我正在建立一个基于少量嵌套fluidRow&列如下:

pwd

运行良好。但是,当我尝试使用黄色框中的runApp(list( ui = fluidPage( fluidRow( column(9, style = "background-color:green;", div(style = "height:600px;")), column(3, fluidRow( column(12, style = "background-color:yellow;", div(style = "height:200px;"))), fluidRow( column(12, style = "background-color:black;", div(style = "height:200px;"))), fluidRow( column(12, style = "background-color:red;", div(style = "height:200px;")))) ) ), server = function(input, output) { } )) 函数发表评论时,整个列的大小会增加:

h6()

有人可以指出我哪里出错了。在这个Shiny页面中,我想做两件事: 1.添加一些评论是黄色,黑色和&红盒子没有改变任何盒子形状和, 2.要在黑框中将字体颜色更改为白色

感谢任何指针。

谢谢,

1 个答案:

答案 0 :(得分:0)

您无需在style = "height: ..px;"内提供div,您可以将其与之前的风格一起添加。

代码如下:

 runApp(list(
      ui = fluidPage(
        fluidRow(
          column(9, style = "background-color:green; height:600px;"), 

          column(3, 
                 fluidRow(
                   column(12, style = "background-color:yellow; height:200px", h1(strong('Title')), h6('Some comment Some comment Some comment Some comment'))),
                 fluidRow(
                   column(12, style = "background-color:black;height:200px;")),
                 fluidRow(
                   column(12, style = "background-color:red; height:200px;")))
        )
      ),
      server = function(input, output) {
      }
    ))

所以你会得到这样的东西: enter image description here

希望它有所帮助!