5

I have the following RMarkdown FlexDashboard document:

---
title: "Some title"
runtime: shiny
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

```{r setup, include=FALSE}
library(flexdashboard)
```

Column {data-width=650}
-----------------------------------------------------------------------

### Some chart

```{r}
plot(faithful)
```

Column {data-width=650}
-----------------------------------------------------------------------

### Chart 2

```{r}
```   

### Chart 3

```{r}
```

How can I put the footer that span across the page with the following content?

tags$div( HTML("<footer><small>&copy; Copyright 2017, MyCompany Co.,Ltd</small></footer>"))   

enter image description here

neversaint
  • 60,904
  • 137
  • 310
  • 477

2 Answers2

9

You can put the HTML of your footer in a footer.html file and include it after the body of your flexdashboard using after_body in your markdown:

---
title: "Some title"
runtime: shiny
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    includes:
      after_body: footer.html
---
NicE
  • 21,165
  • 3
  • 51
  • 68
  • I tried that by putting `footer.html` inside `www`. But I get error message `pandoc: footer.html: openFile: does not exist (No such file or directory) Error: pandoc document conversion failed with error 1 Execution halted` – neversaint Apr 20 '17 at 12:26
  • 2
    Don't need to put it in a `www` folder, it has to be in the same folder as the `.Rmd` file. – NicE Apr 20 '17 at 12:29
  • 1
    How about adding footer at a fixed position (just 10px above the bottom of the page) in the `.sidebar` of flexdashboard? – LeMarque Nov 22 '18 at 21:08
0

You can try this:

tags$footer( HTML("<footer><small><b>&copy; Manoj Kumar 2021.</b></small></footer>"), align="left", style="position:absolute; bottom:0; width:95%; height:50px; color: #000000; padding: 0px; background-color: transparent; z-index: 1000;")
Manoj Kumar
  • 5,273
  • 1
  • 26
  • 33