Columna
Apila sus hijos en vertical, con spacing, padding, align en el eje cruzado y un max_width opcional. Como row, las listas anidadas se aplanan y se ignoran None/False.
pz.column · Categoría: Disposición · Referencia completa →


box = lambda text, w=90, h=44: pz.container(ui.label(text), center=True, width=w, height=h, bg=pz.theme.current().element, radius=6)pz.row([ pz.column([box("1"), box("2"), box("3")], spacing=8), pz.column([box("wide", w=160), box("center"), box("end")], spacing=8, align="center"), pz.column([box("top"), pz.vspace(), box("bottom")], spacing=8, height=170),], spacing=32)Cuándo usarlo
Sección titulada «Cuándo usarlo»- Para formularios, listas, contenido de páginas y la raíz de casi cualquier
view().
import pyzed as pzfrom pyzed import ui
box = lambda text, w=90, h=44: pz.container(ui.label(text), center=True, width=w, height=h, bg=pz.theme.current().element, radius=6)pz.row([ pz.column([box("1"), box("2"), box("3")], spacing=8), pz.column([box("wide", w=160), box("center"), box("end")], spacing=8, align="center"), pz.column([box("top"), pz.vspace(), box("bottom")], spacing=8, height=170),], spacing=32)Variantes
Sección titulada «Variantes»Alineación cruzada
Sección titulada «Alineación cruzada»

align="start"Código
box = lambda text, w=90, h=44: pz.container(ui.label(text), center=True, width=w, height=h, bg=pz.theme.current().element, radius=6)pz.column([box("wide", w=160), box("B"), box("C")], spacing=8, align="start")

align="center"Código
box = lambda text, w=90, h=44: pz.container(ui.label(text), center=True, width=w, height=h, bg=pz.theme.current().element, radius=6)pz.column([box("wide", w=160), box("B"), box("C")], spacing=8, align="center")

align="end"Código
box = lambda text, w=90, h=44: pz.container(ui.label(text), center=True, width=w, height=h, bg=pz.theme.current().element, radius=6)pz.column([box("wide", w=160), box("B"), box("C")], spacing=8, align="end")Opciones
Sección titulada «Opciones»

spacing=16Código
box = lambda text, w=90, h=44: pz.container(ui.label(text), center=True, width=w, height=h, bg=pz.theme.current().element, radius=6)pz.column([box("1"), box("2")], spacing=16)

pz.vspace()Código
box = lambda text, w=90, h=44: pz.container(ui.label(text), center=True, width=w, height=h, bg=pz.theme.current().element, radius=6)pz.column([box("top"), pz.vspace(), box("bottom")], height=170)

padding=16Código
box = lambda text, w=90, h=44: pz.container(ui.label(text), center=True, width=w, height=h, bg=pz.theme.current().element, radius=6)pz.container(pz.column([box("1"), box("2")], spacing=8, padding=16), border_color=pz.theme.current().border, border_width=1, radius=8)Eventos
Sección titulada «Eventos»Columna no tiene eventos propios: muestra lo que le das. Como todo widget, también tiene los 18 eventos comunes (click, double_click, right_click, mouse_enter, drag, key_down, resize…), que se conectan con .on(...): mira Eventos y Eventos de cada componente.
Propiedades y API
Sección titulada «Propiedades y API»pz.column
Sección titulada «pz.column»column( children=None, *, spacing=0.0, padding=None, width=None, height=None, align=None, max_width=None, clip=False,)Apila los hijos en vertical.
| Propiedad | Por defecto | Descripción |
|---|---|---|
children |
None |
Lista de hijos. Se aplanan listas anidadas y se ignoran None y False, así que puedes escribir cond and widget. |
spacing |
0.0 |
Separación entre hijos, en píxeles. |
padding |
None |
Relleno interior: 8, (vertical, horizontal) o (arriba, derecha, abajo, izquierda). |
width |
None |
Ancho: píxeles, "fill", "shrink" o "fill:N" (proporción). |
height |
None |
Alto: píxeles, "fill", "shrink" o "fill:N" (proporción). |
align |
None |
Alineación de los hijos en el eje cruzado: "start", "center" o "end". |
max_width |
None |
Ancho máximo en píxeles. |
clip |
False |
Recorta el contenido que se sale de los límites. |
Relacionados
Sección titulada «Relacionados»FilaColoca los hijos en horizontal.
DesplazableDesplaza el contenido que no cabe.
EspacioHuecos fijos y separadores flexibles.