R in Shiny: How can I adjust radio buttons to the grid width of column? -


the question straightforward. code contains following lines:

fluidrow(    column(12, "some text"), fluidrow(    column(12, radiobuttons("buttons", "please select choice", choices = list("a" = 1, "b" = 2, "c" = 3), selected = false, inline = true))) 

i choices (radio buttons) evenly spread on grid width. appreciated!

you need use additional css parameters this.

assuming parameters choices:

parameters <- c("a", "b", "c", "d") 

to have multi-column radio buttons: add additional class:

controls <-list(tags$div(align = 'left',                        class = 'multicol',                        radiobuttons(inputid  = 'buttons',                                           label = "select parameters: ",                                          choices  = parameters,                                          selected = "a",                                          inline   = false), style = "font-size:90%"))  

and apply css values added class:

tweaks <- list(tags$head(tags$style(html("                                        .multicol {                                         height: 150px;                                        -webkit-column-count: 5; /* chrome, safari, opera */                                         -moz-column-count: 5;    /* firefox */                                         column-count: 5;                                         -moz-column-fill: auto;                                        -column-fill: auto;                                        }                                         "))  )) 

by resetting column-count....you fit radio buttons across desired number of columns. can use object tweaks outside ui (before ui starts or in global.r). work checkboxes too.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -