How to create title above tabpanels at the center in Rshiny app

...I'm trying to create a layout with two images right and left side with title panel aligned above tab panels. Unfortunately title is coming beside tabs. I tried using navbarpagetext using a function.

How to align title and tabpanel between twoimages using combination of fluidpage and navbarPage combination

ui2 <- function(){

  navbarPageWithText <- function(..., text) {
    navbar <- navbarPage(...)
    textEl <- tags$h3(class = "navbar-text", text)
    navbar[[3]][[1]]$children[[1]]<- htmltools::tagAppendChildren(
      navbar[[3]][[1]]$children[[1]], textEl)

    list( tags$body(tags$script(type="text/javascript", src = "code.js"),
       #abs {

  display: inline-block;
  list-style-type: none;
  margin_Top: 0;
  padding_Bottom:0 ;
  background-color: #f1f1f1;
  border: 5px solid #555;
  float: left;
  border-image-outset: auto;

      .text {



    navbarPageWithText(text = "Tools for testing",
      title=div(img(id = "abs",src="sai.png",height = 60,width = 110), HTML("<sub>this is the app <br/>SAFETY & TESTING</sub>")),

      # Argument    Description
      # header  Tag or list of tags to display as a common header above all tabPanels.
      # footer  Tag or list of tags to display as a common footer below all tabPanels
      # inverse TRUE to use a dark background and light text for the navigation bar
      # collapsable TRUE to automatically collapse the navigation elements into a menu when the width of the browser is less than 940 pixels (useful for viewing on smaller touchscreen device)
      #theme = shinytheme("flatly"),
      header = tagList(
        textInput("textH", "Text input:")
      footer = "Footer",
      inverse = TRUE,
      collapsible = FALSE,
      # theme = "cerulean",  # <--- To use a theme, uncomment this

      tabPanel(class = "absc","Navbar 1"),

      tabPanel(class = "absc","Tab 2"),
      tabPanel(class = "absc","Tab 3"),

      tabPanel(class = "absc","Navbar 2"),
      tabPanel(class = "absc","Navbar 3")
      # Sub Menu

    ) ))}

You're more likely to get help if you start with a minimal reprex. I'd recommend reading to learn more about it.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.