R shiny mainPanel display style and font

前端 未结 3 794
攒了一身酷
攒了一身酷 2021-01-31 10:16

I\'m learning shiny apps and have some basic questions about tweaking the layout, particularly style and font. I\'d be grateful for pointers or explicit answers, thanks!

相关标签:
3条回答
  • 2021-01-31 10:54

    This is a really old post, but for posterity: you can just put css in your mainPanel() call. If you want a fixed-position plot in the mainPanel in a sidebar layout:

    sidebarLayout(
         sidebarPanel(), 
         mainPanel(style="position:fixed;margin-left:32vw;",
              plotOutput("plot")
         )
    )
    
    0 讨论(0)
  • 2021-01-31 10:54

    Another way to insert styling in Shiny is through its tag command. The result will be the same as inserting plain HTML:

    tags$style(type="text/css", ".span8 .well { background-color: #00FFFF; }")
    

    the result will be the same as inserting plain HTML code (in this example the result would be the same as the last code snippet by Scott)

    0 讨论(0)
  • 2021-01-31 10:59

    You can include arbitrary html, for example, within the call to sidebarpanel, you can do

    HTML('<style type="text/css">
         .row-fluid .span4{width: 26%;}
         </style>')
    

    this is just something copied from one of my Shiny apps

    You could use inspector tools in the browser to figure out what css elements need to be changed.

    If you use a wellPanel inside the mainPanel this modifies that wellPanel to be blue

    HTML('<style type="text/css">
            .span8 .well { background-color: #00FFFF; }
            </style>'), 
    
    0 讨论(0)
提交回复
热议问题