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
Post a Comment