View source: R/widget-containers.R
| grid_layout | R Documentation |
Places children in a grid, row by row. Column (and optionally row)
tracks are sized like widgets: a number of cells, "auto" (natural size
of the content), "<n>fr" (share of the remaining space) or "<n>%".
Rows not listed are "auto". A child can cover several cells with
style(column_span = 2, row_span = 2).
grid_layout(
...,
columns = 2L,
rows = NULL,
gap = 0L,
id = NULL,
classes = NULL,
style = NULL
)
... |
Child widgets. |
columns |
A number of equal columns, or a vector of column sizes. |
rows |
Optional vector of row sizes. |
gap |
Space between cells: one value, or |
id |
Optional identifier. |
classes |
Optional classes. |
style |
A |
Named grid_layout() because grid() would mask graphics::grid().
A Grid widget.
ui <- grid_layout(
label("a"), label("b"), label("c"),
label("wide", style = style(column_span = 2)),
columns = c("1fr", "2fr"), gap = 1
)
render_widget(ui, 20, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.