grid() html()
Rows and columns of the Bootstrap grid from an array: equal widths unless a cell sets col.
html()->grid($data = [], $extra = [])Options
| Option | Meaning |
|---|---|
$data | Rows of cells: ['body'] or ['body', 'col' => 4, 'class' => ...], or a plain string. |
class, id | Classes; id. |
Example
s1
s1
s1
s1
s1
s1
s1
s1
s1
s1
s1
s1
s4
s4
s4
s4
s8
s6
s6
s12
Code
return html()->grid([
[['s1'], ['s1'], ['s1'], ['s1'], ['s1'], ['s1'], ['s1'], ['s1', 'class' => 'btn btn-warning'], ['s1'], ['s1', 'class' => 'btn btn-primary'], ['s1'], ['s1']],
[['s4'], ['s4'], ['s4']],
[['s4', 'col' => 4, 'class' => 'alert alert-danger'], ['s8', 'col' => 8, 'class' => 'alert alert-info']],
[['s6'], ['s6']],
['s12'],
]);Bootstrap 3 and 5
Bootstrap 3 grid col-md-*; Bootstrap 5 row / col-md-* too.
See also: html/panel