mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add example for grid rows.
This commit is contained in:
11
docs/examples/styles/grid_rows.css
Normal file
11
docs/examples/styles/grid_rows.css
Normal file
@@ -0,0 +1,11 @@
|
||||
Grid {
|
||||
grid-size: 2 5;
|
||||
grid-rows: 1fr 6 25%;
|
||||
}
|
||||
|
||||
Label {
|
||||
border: round white;
|
||||
content-align: center middle;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
22
docs/examples/styles/grid_rows.py
Normal file
22
docs/examples/styles/grid_rows.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from textual.app import App
|
||||
from textual.containers import Grid
|
||||
from textual.widgets import Label
|
||||
|
||||
|
||||
class MyApp(App):
|
||||
def compose(self):
|
||||
yield Grid(
|
||||
Label("1fr"),
|
||||
Label("1fr"),
|
||||
Label("height = 6"),
|
||||
Label("height = 6"),
|
||||
Label("25%"),
|
||||
Label("25%"),
|
||||
Label("1fr"),
|
||||
Label("1fr"),
|
||||
Label("height = 6"),
|
||||
Label("height = 6"),
|
||||
)
|
||||
|
||||
|
||||
app = MyApp(css_path="grid_rows.css")
|
||||
Reference in New Issue
Block a user