Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shiny R aligning buttons

I have two buttons in my U.i file

div(style="display:inline-block",submitButton("Analysis")),
  div(style="display:inline-block",downloadButton('downloadData', 'Download Data'))

Which gives the following output in the app

enter image description here

However I am trying to align these buttons so that the download data is on the right in the grey box and the analysis button is on the left in the grey box, instead of how it looks now. How do i go about this? The intended use is to become more advanced and create another button which is in the middle of the grey box. Im assuming you do something similar to

style="display:center-align"
style="display:right-align"
style="display:left-align"

but I'm not sure how to go about this process.

like image 946
Vik Avatar asked Feb 26 '15 18:02

Vik


2 Answers

This works:

div(style="display:inline-block",submitButton("Analysis"), style="float:right"),
div(style="display:inline-block",downloadButton('downloadData', 'Download Data'), style="float:right")

But you should consider using a stylesheet, like explained in this answer: https://stackoverflow.com/a/25390164/1117932

like image 188
Verena Haunschmid Avatar answered Nov 19 '22 12:11

Verena Haunschmid


I tried with the @Verena Haunschmid answer but it didn't work. This worked for me (it's pretty similar):

div(style = "display:inline-block; float:right", actionButton("hideshow", "Hide/Show"))
like image 2
Abraham JA Avatar answered Nov 19 '22 12:11

Abraham JA