Learn R Programming

cascadess (version 0.1.0)

display: Display

Description

The display() function adjusts how a tag element is rendered. For example, to use the flex box layout the display must be "flex".

Usage

display(x, type)

Arguments

x

A tag element or .style pronoun.

type

A responsive argument.

One of "inline", "inline-block", "block", "grid", "table", "table-cell", "table-row", "flex", "inline-flex", or "none".

Block vs inline

div(
  div(
    .style %>%
      border("blue"),
    "block"
  ),
  div(
    .style %>%
      border("blue"),
    "block"
  )
)

block

block

div(
  div(
    .style %>%
      border("blue") %>%
      display("inline"),
    "inline"
  ),
  div(
    .style %>%
      border("blue") %>%
      display("inline"),
    "inline"
  )
)

inline

inline

Examples

Run this code
# NOT RUN {
library(htmltools)

# When using flex make sure you specify the flex display.
div(
  .style %>%
    display("flex") %>%
    flex(justify = "center"),
  "Powerful stuff"
)

# }

Run the code above in your browser using DataLab