Add full-height toggle to Markdown table scroll wrapper
What does this MR do and why?
Closes Allow opting a markdown table out of the max-he... (#632102).
Since Implement Sticky Table Headers in GitLab Tables (#585265 - closed), tables in Markdown content are scrollable, capped at 70% of the viewport height. Some long tables are really hard to read this way.
Add a "Show full table" / "Collapse table" button below tables that are long enough to scroll. The decision is stored as a user preference in localStorage, and all tables on-page toggle together.
Note that the rich-text editor is out of scope for this change; it needs its own work.
Screenshots or screen recordings
Behold!, the beauty of table!
| What | Before | After | What |
|---|---|---|---|
| Collapsed (only state) | ![]() | ![]() | Collapsed |
![]() | Expanded |
How to set up and validate locally
- Make a really long table in a Markdown area with lots of rows.
- Now double it.
- Look at it: it should scroll vertically.
- Check out this bad boy of an MR.
- Refresh your table. See that "Show full table" button at the bottom?
- Click it. The table should now expand to its full height, and the button now read "Collapse table".
- Refresh the page. The table should still expanded to its full height.
- Click the "Collapse table" button. The table should contract back to the original height.
- Cut the table to a few measly rows and save.
- The button should not appear.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.


