Wide slate_table: horizontal scroll instead of clipping columns #4
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
kahliburke/KaimonSlate.jl!4
Loading…
Reference in a new issue
No description provided.
Delete branch "table-horizontal-scroll"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wide
slate_table: horizontal scroll instead of clipping columnsProblem
A table wider than its cell has no horizontal scrollbar — the data past the cell width is simply inaccessible. The interactive table is laid out as:
width:100%pins the table to the cell width, so a many-column table squeezes its columns and the nowrap/ellipsis rules clip whatever doesn't fit, with no way to pan to it. This affects every interactive table path:slate_table(df), DataFrame auto-render, inline{{ df }}in markdown cells, andTableSelect.(The bare-DataFrame HTML path already handles this —
.disp.html div.data-framehasoverflow-x:auto— so the two table renderers currently behave inconsistently.)Fix
Same pattern as the bare-DataFrame path:
_buildShell(core.js) wraps the<table>in a.st-scrolldiv — only the table pans; the filter bar and pagination stay put..st-scroll { overflow-x:auto; max-width:100%; }and the table switcheswidth:100%→min-width:100%, so narrow tables still fill the cell while wide ones grow to their natural width and scroll.wrap._refsand the sort/filter/selection handlers are untouched —_refreshTableanddrawTablework unchanged, and both table hosts (.tablesoutput area and inline.itableplaceholders) flow through_buildShell, so all four table paths get the fix.Notes
position:sticky; top:0now sticks within the scroll wrapper rather than the page. With paginated tables (default 25 rows) this isn't a visible change.max-width:340px+ ellipsis is kept — it guards against a single pathological cell, and with scrolling the columns are no longer lost.Testing
.st-bar/.st-scroll > .st-table/.st-pagwith_refsintact.