docs/styles/grid/grid_rows.md
The grid-rows style allows to define the height of the rows of the grid.
!!! note
This style only affects widgets with `layout: grid`.
--8<-- "docs/snippets/syntax_block_start.md" grid-rows: <a href="../../../css_types/scalar"><scalar></a>+; --8<-- "docs/snippets/syntax_block_end.md"
The grid-rows style takes one or more <scalar> that specify the length of the rows of the grid.
If there are more rows in the grid than scalars specified in grid-rows, they are reused cyclically.
If the number of <scalar> is in excess, the excess is ignored.
The example below shows a grid with 10 labels laid out in a grid with 5 rows and 2 columns.
We set grid-rows: 1fr 6 25%.
Because there are more rows than scalars in the style definition, the scalars will be reused:
1fr;6; and25%.=== "Output"
```{.textual path="docs/examples/styles/grid_rows.py"}
```
=== "grid_rows.py"
```py
--8<-- "docs/examples/styles/grid_rows.py"
```
=== "grid_rows.tcss"
```css hl_lines="3"
--8<-- "docs/examples/styles/grid_rows.tcss"
```
/* Set all rows to have 50% height */
grid-rows: 50%;
/* Every other row is twice as tall as the first one */
grid-rows: 1fr 2fr;
grid.styles.grid_rows = "50%"
grid.styles.grid_rows = "1fr 2fr"
grid-columns to specify the width of the grid columns.