bindFillRole {htmltools} | R Documentation |
Allow tags to intelligently fill their container
Description
Create fill containers and items. If a fill item is a direct child of a fill container, and that container has an opinionated height, then the item is allowed to grow and shrink to its container's size.
Usage
bindFillRole(
x,
...,
item = FALSE,
container = FALSE,
overwrite = FALSE,
.cssSelector = NULL
)
Arguments
x |
a |
... |
currently unused. |
item |
whether or not to treat |
container |
whether or not to treat |
overwrite |
whether or not to override previous calls to
|
.cssSelector |
A character string containing a CSS selector for
targeting particular (inner) tag(s) of interest. For more details on what
selector(s) are supported, see |
Value
The original tag object (x
) with additional attributes (and a
htmlDependency()
).
Examples
tagz <- div(
id = "outer",
style = css(
height = "600px",
border = "3px red solid"
),
div(
id = "inner",
style = css(
height = "400px",
border = "3px blue solid"
)
)
)
# Inner doesn't fill outer
if (interactive()) browsable(tagz)
tagz <- bindFillRole(tagz, container = TRUE)
tagz <- bindFillRole(tagz, item = TRUE, .cssSelector = "#inner")
# Inner does fill outer
if (interactive()) browsable(tagz)