html - Positioning the text within Action Button in R shiny -
i want fit resource activity text within given button such activity comes below resource in button. complete word gets hidden because of less space of button , not want increase space. please help.
## app.r ## library(shiny) library(shinydashboard) ui <- dashboardpage( dashboardheader(), dashboardsidebar(), dashboardbody( actionbutton("buttonresinvthree", "resource activity",style="color: #000000; width:8%; ") ) ) server <- function(input, output) { } shinyapp(ui, server)
the following works me:
## app.r ## library(shiny) library(shinydashboard) library(tablehtml) ui <- dashboardpage( dashboardheader(), dashboardsidebar(), dashboardbody( tags$head(tags$style(make_css(list('.btn', 'white-space', 'pre-wrap')))), actionbutton("buttonresinvthree", html("resource\nactivity"), style="color: #000000; width:8%; ") ) ) server <- function(input, output) { } shinyapp(ui, server)
i added tags$head...
add css
button (class btn) , used \n
break line between resource\nactivity
.
the result looks this:
Comments
Post a Comment