mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add example for row-span.
This commit is contained in:
30
docs/examples/styles/row_span.css
Normal file
30
docs/examples/styles/row_span.css
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#p1 {
|
||||||
|
row-span: 4;
|
||||||
|
}
|
||||||
|
#p2 {
|
||||||
|
row-span: 3;
|
||||||
|
}
|
||||||
|
#p3 {
|
||||||
|
row-span: 2;
|
||||||
|
}
|
||||||
|
#p4 {
|
||||||
|
row-span: 1; /* Didn't need to be set explicitly. */
|
||||||
|
}
|
||||||
|
#p5 {
|
||||||
|
row-span: 3;
|
||||||
|
}
|
||||||
|
#p6 {
|
||||||
|
row-span: 2;
|
||||||
|
}
|
||||||
|
#p7 {
|
||||||
|
/* Default value is 1. */
|
||||||
|
}
|
||||||
|
|
||||||
|
Grid {
|
||||||
|
grid-size: 4 4;
|
||||||
|
grid-gutter: 1 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
Placeholder {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
19
docs/examples/styles/row_span.py
Normal file
19
docs/examples/styles/row_span.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
from textual.app import App
|
||||||
|
from textual.containers import Grid
|
||||||
|
from textual.widgets import Placeholder
|
||||||
|
|
||||||
|
|
||||||
|
class MyApp(App):
|
||||||
|
def compose(self):
|
||||||
|
yield Grid(
|
||||||
|
Placeholder(id="p1"),
|
||||||
|
Placeholder(id="p2"),
|
||||||
|
Placeholder(id="p3"),
|
||||||
|
Placeholder(id="p4"),
|
||||||
|
Placeholder(id="p5"),
|
||||||
|
Placeholder(id="p6"),
|
||||||
|
Placeholder(id="p7"),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
app = MyApp(css_path="row_span.css")
|
||||||
Reference in New Issue
Block a user