Skip to content

Conversation

@nojaf
Copy link
Contributor

@nojaf nojaf commented Sep 23, 2025

📝 Summary

Sorry if this is more of an feature request than an actual PR.
We have long and wide tables in our organization and wish to improve scroll through this vertically.
(We are using pagination=False to see all rows)

freeze_columns works well nicely for horizontal scrolling.
But when a table is long:

  • The table takes the entire page, and the scrollbar is on the page level.
  • The header is gone as soon as your scroll.

🔍 Description of Changes

It would be interesting if we could have something long these lines:

Kapture 2025-09-23 at 11 32 25

  • Scrollbar is on the table
  • Header is sticky

(table header is red for dramatic effect)

Could we have something that brings this experience?
If so, I'd be happy to work on this in whatever solution you deem best.

//cc @mscolnick @Light2Dark

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • I have added tests for the changes made.
  • I have run the code and verified that it works as expected.

@vercel
Copy link

vercel bot commented Sep 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marimo-docs Ready Ready Preview Comment Sep 25, 2025 9:51am

@Light2Dark
Copy link
Contributor

I like the idea! Do you also want to pass in python params to control this? Eg. max_height and sticky_header

this is kinda interesting from plotly:

app.layout = dash_table.DataTable(
    data=df.to_dict('records'),
    columns=[{'id': c, 'name': c} for c in df.columns],
    style_table={'height': '300px', 'overflowY': 'auto'}  # <---
)

@nojaf
Copy link
Contributor Author

nojaf commented Sep 23, 2025

Hi @Light2Dark, yes, perhaps some control makes sense.
However, a single style object won't fit the bill here.
It needs a change to the thead and wrapper div so I wonder how to expose this to the end-user. Expecting them to pass the right css objects puts a high bar at understanding how this internally works. So, I'm not quite sure about this one.

@mscolnick
Copy link
Contributor

my preference would be to avoid css styles as the args to get this and it is a flag that handles it (e.g. scrollable or just max_height and its always scrollable)

@nojaf
Copy link
Contributor Author

nojaf commented Sep 23, 2025

So, max_height as int? And do we derive sticky from that value or would you have another setting to control that?
Does max_height mean pagination=False or should that still be set by the user?

@mscolnick
Copy link
Contributor

So, max_height as int?

Yep i think an Optional[int]

And do we derive sticky from that value or would you have another setting to control that?

Yea i think if max-height is set, create a variable hasMaxHeight and then make it sticky

Does max_height mean pagination=False or should that still be set by the user?

We can leave these separate and have the user config. give the flexibility of pagination 100 but still a max-height

@mscolnick mscolnick merged commit e41ee81 into marimo-team:main Sep 25, 2025
35 of 37 checks passed
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

Successfully merging this pull request may close these issues.

3 participants