Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Testing different table rendering engines
---
title: "Testing different table rendering engines"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(DT)
library(dplyr)
library(rhandsontable)
values <- reactiveValues(data = data.frame(x = c(1,2), y = c("A", "B")))
```
Inputs {.sidebar}
-------------------------------------
```{r sidebar}
br()
actionButton("addRow", "Add row to data")
observeEvent(input$addRow, {
values$data <- bind_rows(values$data, data.frame(x = 2, y = "BBBBBBBBBBBBBB"))
})
```
Column
-----------------------------------------------------------------------
### Table A
```{r}
renderTable(values$data)
```
### Table B
```{r}
DT::renderDataTable(values$data, server = FALSE, rownames = FALSE, style = "bootstrap" )
```
Column
-----------------------------------------------------------------------
### Table C
```{r}
p("rhandsontable doesn't show here")
rHandsontableOutput("TableC")
output$TableC <- renderRHandsontable({values$data})
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.