library(shiny)
runGist('5694313')
Last active
April 15, 2018 07:17
-
-
Save sckott/5694313 to your computer and use it in GitHub Desktop.
Shiny - how to make footer stick to bottom of page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
## Set up server output | |
shinyServer(function(input, output) { | |
foo <- reactive({ | |
input$num | |
}) | |
output$plot <- renderPlot({ | |
number <- foo() | |
plot(rnorm(number)) | |
}) | |
output$plot2 <- renderPlot({ | |
number <- foo() | |
plot(rnorm(number)) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyUI(pageWithSidebar( | |
headerPanel(title=HTML("TaxaViewer - <i>Explore data on your species list</i> "), windowTitle="TaxaViewer"), | |
sidebarPanel( | |
wellPanel( | |
h4(strong("Do something")), | |
textInput(inputId="num", label="Number", value=I(10^5)) | |
) | |
), | |
mainPanel( | |
tags$style(type = 'text/css', | |
"footer{position: absolute; bottom:5%; left: 33%; padding:5px;}" | |
), | |
tabsetPanel( | |
tabPanel("output", | |
plotOutput("plot"), | |
HTML('<footer> | |
<img src="http://amor.cms.hu-berlin.de/~huangrui/images/softwares/Rlogo.png", height="120", width="120"</img> | |
</footer>') | |
), | |
tabPanel("output", | |
plotOutput("plot2"), | |
HTML('<footer> | |
<img src="http://jasontheodor.com/wp-content/uploads//2012/02/things.jpg", height="120", width="120"</img> | |
</footer>') | |
) | |
)) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add these lines inside the dashboard body
tags$footer(title="Your footer here", align = "right", style = "
position:absolute;
bottom:0;
width:100%;
height:50px; /* Height of the footer */
color: white;
padding: 10px;
background-color: black;
z-index: 1000;"
)