table: Boostrap 4 table container

Description Usage Arguments Author(s) Examples

Description

Build an Bootstrap 4 table container

Build an bs4 table item row

Build an bs4 table item

Usage

1
2
3
4
5
bs4Table(data, cardWrap = FALSE, bordered = FALSE, striped = FALSE, width = 12)

bs4TableItems(...)

bs4TableItem(..., dataCell = FALSE)

Arguments

data

Expect dataframe, tibble or list of shiny tags... See examples.

cardWrap

Whether to wrap the table in a card. FALSE by default.

bordered

Whether to display border between elements. FALSE by default.

striped

Whether to displayed striped in elements. FALSE by default.

width

Table width. 12 by default.

...

Any HTML element.

dataCell

Whether the cell should be contain data or text. <td> by default.

headTitles

Table header names. Must have the same length as the number of bs4TableItem in bs4TableItems. Set "" to have an empty title field.

Author(s)

David Granjon, dgranjon@ymail.com

Examples

 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
48
49
50
51
52
53
54
55
56
57
if (interactive()) {
 library(shiny)
 library(bs4Dash)
 
 # width dataframe as input
 shinyApp(
  ui = dashboardPage(
    header = dashboardHeader(), 
    sidebar = dashboardSidebar(),
    body = dashboardBody(
     bs4Table(
      cardWrap = TRUE,
      bordered = TRUE,
      striped = TRUE,
      iris
     )
    ), 
    footer = dashboardFooter()
  ),
  server = function(input, output) { }
 )
 
 # with shiny tags as input
 shinyApp(
  ui = dashboardPage(
    header = dashboardHeader(), 
    sidebar = dashboardSidebar(),
    body = dashboardBody(
      bs4Table(
        cardWrap = TRUE,
        bordered = TRUE,
        striped = TRUE,
        list(
          list(
            income = "$2,500 USD", 
            status = dashboardBadge(
              "Pending",
              position = "right",
              color = "danger",
              rounded = TRUE
            ), 
            progress = progressBar(value = 50, status = "pink", size = "xxs"), 
            text = "test", 
            confirm = actionButton(
              "go",
              "Go"
            )
          ),
          list("$2,500 USD", "NA", "NA", "test", "NA")
        )
      )
    ), 
    footer = dashboardFooter()
  ),
  server = function(input, output) {}
 )
}

bs4Dash documentation built on July 23, 2021, 5:06 p.m.