Description Usage Arguments Value Examples
View source: R/vars-bootstrap.R
Those variables can be used to customize
table (produced ever by shiny::renderTable
or by shiny::renderDataTable
and DT equivalent)
in Bootstrap and Bootswatch themes.
1 2 3 4 5 6 7 8 9 |
cell_padding |
Cell padding. |
condensed_cell_padding |
Cell padding when using condensed table. |
bg |
Background color. |
bg_accent |
Background color used in striped table. |
bg_hover |
Background color used when hovering the table with the mouse. |
bg_active |
Background color when row is selected. |
border_color |
Border color. |
a list
that can be used in create_theme
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | bs_vars_table(
bg_accent = "lightblue",
bg_hover = "firebrick"
)
if (interactive()) {
library(shiny)
library(fresh)
ui <- fluidPage(
use_theme(create_theme(
theme = "default",
bs_vars_table(
bg_accent = "lightblue",
bg_hover = "firebrick"
)
)),
tags$h1("Tables"),
fluidRow(
column(
width = 6,
tableOutput("table")
),
column(
width = 6,
dataTableOutput("datatable")
)
)
)
server <- function(input, output, session) {
output$table <- renderTable(
head(iris), striped = TRUE, hover = TRUE
)
output$datatable <- renderDataTable({
head(mtcars)
})
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.