Skip to content

Feature request: fixed_bottom_rows for DataTable #6426

@Kohei-Wada

Description

@Kohei-Wada

Feature Request

Add a fixed_bottom_rows reactive attribute to DataTable, analogous to the existing fixed_rows (which pins rows to the top).

Motivation

fixed_rows is great for keeping header-like rows visible while scrolling, but there's no equivalent for pinning rows to the bottom of the table. This is a common need for summary/totals/workload rows that should always remain visible regardless of vertical scroll position.

Use case

I'm building a Gantt chart with a workload summary row at the bottom. Currently this row scrolls off-screen when there are many tasks. I'd like it to stay pinned at the bottom, just as date headers stay pinned at the top via fixed_rows.

Workarounds considered

  • Splitting into two DataTables (main + footer): column widths can be matched, but horizontal scroll becomes independent between the two tables, so the timeline columns get out of sync.
  • Syncing scroll_x between two tables via watch: introduces visual lag and feels hacky.
  • Placing the summary row at the top with fixed_rows: semantically wrong for a totals/summary row.

None of these are satisfactory.

Proposed API

table = DataTable()
table.fixed_rows = 3         # existing: pin first 3 rows to top
table.fixed_bottom_rows = 1  # new: pin last 1 row to bottom

The fixed_bottom_rows attribute would:

  • Keep the last N rows visible at the bottom of the scrollable area
  • Apply the existing datatable--fixed component style (or a new datatable--fixed-bottom style)
  • Work independently of fixed_rows

Implementation notes

The rendering logic in _get_fixed_offset and render_line would need to account for bottom-fixed rows:

  • Calculate the height occupied by bottom-fixed rows
  • Exclude them from the scrollable region
  • Render them at the bottom of the visible area

This mirrors how fixed_rows works for the top, applied symmetrically to the bottom.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions