Last active
December 25, 2015 09:09
-
-
Save RCura/6951853 to your computer and use it in GitHub Desktop.
Align table and buttons in Shiny
This file contains hidden or 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
| shinyServer(function(input, output,session) { | |
| output$Fbuttons <- renderUI({ | |
| outlist <- list(verbatimTextOutput("Decrease")) | |
| posButtons <- lapply(1:input$n, function(i) { | |
| actionButton(paste0("btnF",i), "+") | |
| }) | |
| outlist <- c(outlist, posButtons) | |
| }) | |
| output$Bbuttons <- renderUI({ | |
| outlist <- list(verbatimTextOutput('Increase')) | |
| negButtons <- lapply(1:input$n, function(i) { actionButton(paste0("btnB",i), "-") }) | |
| outlist <- c(outlist, negButtons) | |
| }) | |
| output$alpha <- renderTable({ | |
| data.frame(Data=1:input$n, stringsAsFactors=FALSE) | |
| }) | |
| }) |
This file contains hidden or 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
| shinyUI(basicPage( | |
| numericInput("n", "N", 4), | |
| br(), | |
| div( | |
| style="display: inline-block; vertical-align: text-top; ", | |
| div(class="btn-group btn-group-vertical span4", | |
| uiOutput("Bbuttons") | |
| ), | |
| div(class="span4",uiOutput("alpha")), | |
| div(class="btn-group btn-group-vertical span4", | |
| uiOutput("Fbuttons") | |
| ) | |
| ), | |
| br() | |
| )) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added a blank line (using verbatimTextOutput, something might be better) to skip the df header row