column | R Documentation |
These functions are the foundation of any application. Grid elements are
nested as follows: container() > columns() > column() ~ column()
. A
column()
may be created with an explicit width, 1 through 12. To fit a
column automatically to its content use width = "content"
. To divide the
space in a row evenly amongst all columns use width = "equal"
. For examples
and usage tips see the sections below.
column(..., width = "equal")
columns(...)
container(..., centered = FALSE)
... |
Any number of tags elements passed as child elements or named arguments passed as HTML attributes to the parent element. |
width |
A responsive argument. One of |
centered |
One of |
container( columns( column( "Aliquam erat volutpat." ), column( "Mauris mollis tincidunt felis." ), column( "Cum sociis natoque penatibus et magnis dis parturient montes,", "nascetur ridiculus mus." ) ) )
container( columns( column( width = 4, # <- card( h5("Sidebar panel") ) ), column( h5("Main panel") ) ) )
Use the responsive width
argument to make mobile
friendly applications. On extra small screens each column spans the
entire width of the row. On larger screens the columns will instead
split the row width evenly.
container( columns( column( width = c(xs = 12, sm = 4), "Mauris ac felis vel velit tristique imperdiet." ), column( width = c(xs = 12, sm = 4), "Nam vestibulum accumsan nisl." ), column( width = c(xs = 12, sm = 4), "Proin neque massa, cursus ut, gravida ut, lobortis eget, lacus." ) ) )
Columns may be fit to the width of their content. Other columns in this example will split the remaining space equally.
container( columns( column( .style %>% background("warning") ), column( width = "content", "Cras placerat accumsan nulla. Aenean in sem ac leo mollis blandit.", "Nam euismod tellus id erat.", "Donec neque quam, dignissim in, mollis nec, sagittis eu, wisi." ), column( .style %>% background("warning") ) ) )
Without specficiying widths the space in a row is evenly split between columns.
container( columns( column(), column(), column(), column() ) )
Other layout functions:
fieldset()
,
navbar()
,
webpage()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.