Files
textual/docs/styles/grid/column_span.md
Rodrigo Girão Serrão 8c0f1dc83c Fix links to CSS types.
2022-12-22 18:13:36 +00:00

53 lines
1.0 KiB
Markdown

# Column-span
The `column-span` style specifies how many rows a widget will span in a grid layout.
!!! note
This style only affects widgets that are direct children of a widget with `layout: grid`.
## Syntax
--8<-- "docs/snippets/syntax_block_start.md"
column-span: <a href="../../css_types/integer">&lt;integer&gt;</a>;
--8<-- "docs/snippets/syntax_block_end.md"
The style `column-span` accepts a single non-negative [`<integer>`](../../../css_types/integer) that quantifies how many columns the given widget spans.
### Values
--8<-- "docs/snippets/type_syntax/integer.md"
## Example
The example below shows a 4 by 4 grid where many placeholders span over several columns.
=== "Output"
```{.textual path="docs/examples/styles/column_span.py"}
```
=== "column_span.py"
```py
--8<-- "docs/examples/styles/column_span.py"
```
=== "column_span.css"
```css
--8<-- "docs/examples/styles/column_span.css"
```
## CSS
```sass
column-span: 3
```
## Python
```py
widget.styles.column_span = 3
```