Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a question on scrollbar for DataTable : How to make the horizontal scroll bar always visible, not only when scrolling to the bottom in the vertical direction? #4575

Open
1 task done
david-shu opened this issue Dec 16, 2024 · 0 comments

Comments

@david-shu
Copy link

Duplicate Check

Describe the requested feature

How to make the horizontal scroll bar always visible, not only when scrolling to the bottom in the vertical direction?

import flet as ft

def main(page: ft.Page):
    dt = ft.DataTable(
        columns=[
            ft.DataColumn(ft.Text("First name")),
            ft.DataColumn(ft.Text("Last name")),
            ft.DataColumn(ft.Text("Age"), numeric=True),
        ],
        
        rows=[
            ft.DataRow(
                cells=[
                    ft.DataCell(ft.Text("John")),
                    ft.DataCell(ft.Text("Smith")),
                    ft.DataCell(ft.Text("43")),
                ],
            ),
        ]*10,
    )

    column = ft.Column(
        controls=[
            ft.Container(
                content=ft.Column(
                    [ft.Row( [dt], scroll=ft.ScrollMode.ALWAYS )],
                    scroll=ft.ScrollMode.ALWAYS
                ),
                expand=2,
            ),
            ft.Container(ft.Text('Anything'), expand=0),
            ft.Container(ft.Text('Anything'), expand=0)
        ],
        height=200,
        width=400
    )

    page.add(ft.SafeArea(column, expand=True))

ft.app(target=main)

Suggest a solution

No response

Screenshots

1
2

Additional details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant