2017-08-04 11 views
2

大きな(h1)フォーマットのタイトルとその横にあるアクションボタンを持つShinyアプリケーションを作成しています。クリックすると、追加の詳細とその他の情報を含むウィンドウがポップアップします。私は、ボタンをセットアップし、うまくいきました(コードには含まれていません)。私の問題は、この行の書式設定にあります。私の最善の努力にもかかわらず、アイコン(アクションボタン)は動的テキストと同じ列にあり、同じh1形式でも新しい行にプッシュされます。どのように私が望むものを達成することができますか?結果のh1フォーマットのタイトルにボタンを配置すると、次の行にプッシュされます(Shiny R)

library(shiny) 

ui <- fluidRow(column(12, tags$h1(textOutput("chosen_date_fact"), 
            actionButton("scoping2", 
               label = icon("info-circle"), 
               style = "color: #000000; background-color: #ffffff; border-color: #ffffff")))) 


server = function(input, output){ 

last_fact_date = '2017-07-16' 

output$chosen_date_fact = renderText ({ 
date = as.Date(last_fact_date) 
paste0('Details of', ' ', format(date,"%B"),' ', '(as of: ', date,')') 
})  
} 

shinyApp(ui = ui, server = server) 

画像:https://i.stack.imgur.com/gmhNM.jpg

は、事前にありがとうございます!

答えて

1

これは何か?もっと多くの例が私が答えた別の質問を訪問するHow to display widgets inline in shiny

library(shiny) 

ui <- fluidRow(column(12, div(style="display: inline-block;",tags$h1(textOutput("chosen_date_fact"))), 
         actionButton("scoping2", label = icon("info-circle"), style = " color: #000000; background-color: #ffffff; border-color: #ffffff") 
)) 


server = function(input, output){ 

    last_fact_date = '2017-07-16' 

    output$chosen_date_fact = renderText ({ 
    date = as.Date(last_fact_date) 
    paste0('Details of', ' ', format(date,"%B"),' ', '(as of: ', date,')') 
    })  
} 

shinyApp(ui = ui, server = server) 
+0

ありがとう、これは大変ありがとうございます! :) – zsoltnyiri

関連する問題