2015-03-10 20 views
12

tôi không thể tìm ra một cách để class đáy downloadButton với một selectizeInput, tức là,đáy sắp xếp một nút trong R bóng

enter image description here

library(shiny) 

runApp(list(
    ui = shinyUI(fluidPage(
    fluidRow(align="bottom", 
     column(12, align="bottom", 
      h4("Download Options:"), 
      fluidRow(align="bottom", 
         column(6, selectizeInput("plot_dl", "File Type", width="100%", 
               choices = list("PDF"="pdf","PNG"="png"))), 
         column(3, downloadButton('plot1_dl', 'Left Plot')), 
         column(3, downloadButton('plot2_dl', 'Right Plot')) 
      ) 
    ) 
    ), 
    tags$style(type='text/css', "#plot1_dl { width:100%; vertical-align:bottom}"), 
    tags$style(type='text/css', "#plot2_dl { width:100%;}") 
)), 
    server = function(input, output) { 
    } 
)) 

Đặt align="bottom" bất cứ nơi nào và ở khắp mọi nơi không ném một thông báo lỗi, nhưng cũng không có hiệu ứng mong muốn. Cố gắng chơi xung quanh với các thẻ phong cách của các nút, nhưng cũng ra chiều sâu của tôi.

Trả lời

15

Tìm thấy một ad-hoc sửa chữa với margin-top: 25px trong thẻ style ...

enter image description here

library(shiny) 

runApp(list(
    ui = shinyUI(fluidPage(
    h4("Download Options:"), 
    fluidRow(
     column(6, selectizeInput("plot_dl", "File Type", width="100%", 
           choices = list("PDF"="pdf","PNG"="png"))), 
     column(3, downloadButton('plot1_dl', 'Left Plot')), 
     column(3, downloadButton('plot2_dl', 'Right Plot')) 
    ), 
    tags$style(type='text/css', "#plot1_dl { width:100%; margin-top: 25px;}"), 
    tags$style(type='text/css', "#plot2_dl { width:100%; margin-top: 25px;}") 
)), 
    server = function(input, output) { 
    } 
)) 
+1

vâng tôi sẽ đề nghị xem xét vào này là tên của selectinput 'File Type' ảnh hưởng đến vị trí –

+1

này dường như không thực hiện bất kỳ sự khác biệt đối với tôi khi tôi thử nó. Tuy nhiên, tôi đang sử dụng 'uiOutput()'. Điều này có thể tạo sự khác biệt không ?? – theforestecologist

6

cách khác để làm điều đó là để vượt qua style luận trong hàm cột.

 
runApp(list(
     ui = shinyUI(fluidPage(
       h4("Download Options:"), 
       fluidRow(
         column(6, selectizeInput("plot_dl", "File Type", width="100%", 
               choices = list("PDF"="pdf","PNG"="png"))), 
         column(3, style = "margin-top: 25px;", downloadButton('plot1_dl', 'Left Plot')), 
         column(3, style = "margin-top: 25px;", downloadButton('plot2_dl', 'Right Plot')) 
       ) 
     )), 
     server = function(input, output) { 
     } 
)) 

Các vấn đề liên quan