Add example for column-span.

This commit is contained in:
Rodrigo Girão Serrão
2022-12-19 18:44:48 +00:00
parent 5ff0f79720
commit 0ccc2bbc00
2 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
#p1 {
column-span: 4;
}
#p2 {
column-span: 3;
}
#p3 {
column-span: 1; /* Didn't need to be set explicitly. */
}
#p4 {
column-span: 2;
}
#p5 {
column-span: 2;
}
#p6 {
/* Default value is 1. */
}
#p7 {
column-span: 3;
}
Grid {
grid-size: 4 4;
grid-gutter: 1 2;
}
Placeholder {
height: 100%;
}

View 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="column_span.css")