Expanding "DataTable" inside "Container" #3560
nastiliano
started this conversation in
General
Replies: 2 comments 5 replies
-
Is there a working example you can show of what you want to do? |
Beta Was this translation helpful? Give feedback.
0 replies
-
When there are many rows in the datatable, hover the mouse over the datatable and turn the middle wheel of the mouse to see the data below. import flet as ft
def main(page: ft.Page):
page.expand = True
# page.scroll=ft.ScrollMode.ALWAYS
# GENERIC TABLE
tbl_Gen = ft.DataTable(
expand=True,
show_bottom_border=True,
heading_row_color=ft.colors.RED,
border=ft.border.all(5, ft.colors.BLACK),
width=800,
height=180,
columns=[
ft.DataColumn(ft.Text("ID")),
ft.DataColumn(ft.Text("Name")),
ft.DataColumn(ft.Text("Surname")),
ft.DataColumn(ft.Text("Etc..."))
]
)
con_Tbl_Gen = ft.Container(
alignment=ft.alignment.top_center,
expand=True,
margin=20,
content=ft.Row(
scroll=ft.ScrollMode.ALWAYS,
controls=[
ft.Column(
width=800,
height=180,
scroll=ft.ScrollMode.ALWAYS,
controls=[
ft.Container(
width=800,
height=180,
padding=5,
bgcolor=ft.colors.GREEN_300,
content=tbl_Gen
)
]
)
]
)
)
# GENERAL LAYOUT
cnt = ft.Container(
expand=True,
content=ft.Container(
ft.Column(
controls=[
ft.Card(
expand=True,
content=ft.Container(
alignment=ft.alignment.top_center,
expand=True,
margin=ft.margin.only(top=20),
content=ft.Row(
scroll=ft.ScrollMode.ALWAYS,
controls=[
ft.Column(
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
scroll=ft.ScrollMode.ALWAYS,
spacing=30,
controls=[
ft.Row(
controls=[
ft.Image(
src=f"https://picsum.photos/500?random",
width=500,
height=500,
fit=ft.ImageFit.NONE),
ft.Image(
src=f"https://picsum.photos/500?random",
width=500,
height=500,
fit=ft.ImageFit.NONE
)
]
)
]
)
]
)
)
),
con_Tbl_Gen,
ft.Card(
expand=True,
content=ft.Container(
alignment=ft.alignment.top_center,
expand=True,
margin=ft.margin.only(top=20),
content=ft.Row(
scroll=ft.ScrollMode.ALWAYS,
controls=[
ft.Column(
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
scroll=ft.ScrollMode.ALWAYS,
spacing=30,
controls=[
ft.Row(
controls=[
ft.Image(
src=f"https://picsum.photos/500?random",
width=500,
height=500,
fit=ft.ImageFit.NONE
)
]
)
]
)
]
)
)
)
]
)
)
)
page.add(cnt)
ft.app(target=main) |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everybody,
Finally I have that I wanted.
A peculiar layout (3 screen divisions) with a central scrollable "DataTable", but for me is impossible to expand it now:
Somebody can help me please??
Thank you very much.
Best regards.
Beta Was this translation helpful? Give feedback.
All reactions