在 checkboxInput() 中,默認情況下,復選框出現在 label 引數中給出的文本之前。我試圖將復選框移到左側,將標簽移到右側。是否有任何 CSS 引數來交換位置也指定標簽和復選框之間的特定間隙?
uj5u.com熱心網友回復:
這主要取自這里:
library(shiny)
ui <- fluidPage(
tags$style("
.cbcontainer {
display: inline-block;
}
.checkbox {
text-align: right;
display: inline-block;
}
.checkbox input {
float: right;
position: relative !important;
margin: 5px !important;
}
.checkbox label {
padding-left: 0px !important;
}
"),
div(checkboxInput("My checkbox", label = "mycheckbox"), class = "cbcontainer")
)
server <- function(input, output, session) {}
shinyApp(ui, server)
為了更好地理解 css 部分,也可以看看這個。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/404940.html
標籤:
上一篇:當“減少”串列時,使用“合并”功能后,如何改變新變數?
下一篇:R:將兩個系列添加到圖形中
