I want both a title and an image in my titlepanel, but the title on the left and the image on the right. I got them both in the panel using this code:
ui <- fluidPage(
titlePanel(div("Fenologische modellen",
img(height = 105, width = 300, src = "logo_pcfruit.jpg"))
),
But then they're just next to eachother. Because align did not work for the image (or "style = ...", tried that too), I decided to put them both in different columns, which requires a fluidRow first.
ui <- fluidPage(
titlePanel(
fluidRow(
column(4, "Fenologische modellen"),
column(4, offset = 8, img(height = 105, width = 300, src = "logo_pcfruit.jpg"))
)
),
What happens is that the image is indeed placed on the right, but it's been placed bottom right, while I need it to be on the same line as the title.
I've tried adjusting the height of the columns in pixels, but under a certain height, it didn't change anymore. The picture above shows the limit.
Any suggestions?
PS: I do not want to group both of them in a wellpanel, unless I can make it completely white and thus invisible.
So I figured it out myself while trying to solve the same problem in a wellPanel.
The bad guy is the offset
argument in column()
. If I remove it, the image and title are horizontally aligned.
To put the image on the right, I just have to make the left column very wide:
titlePanel(
fluidRow(
column(9, "Fenologische modellen"),
column(3, img(height = 105, width = 300, src = "logo_pcfruit.jpg"))
)
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With