Behaviour SwRS-MDOKFSTUDIO-LAYOUT-032
A wide table scrolls inside its own box with shaded edges
When a table is wider than the pane outside Auto breakout, the extension SHALL let it scroll sideways inside its own box, limited to the column width, without widening the page, mark it as overflowing when it is more than 1 px wider than its box so that the theme shades its edges, and keep a cell holding a single word of at most 24 characters on one line. The extension SHALL also give every cell of a content table (not the frontmatter properties table) a minimum width of 5em, so that columns never wrap words letter by letter and a table that no longer fits uses this wide-table behaviour.
Step 1 of path 1 in StRS-MDOKFSTUDIO-LAYOUT-001: from “A document holds a table wider than the pane” to “The table scrolls in its own box and the page does not widen”.
Scenarios 6
The situations the tests check; open one to read it.
nominalService-level table at 460 px
nominalSixteen-column table at 900 px
nominalTable with many columns
refusalTable that fits
boundaryOverflow mark
| Input | Outcome |
|---|---|
| Table with a scroll width of 900 and a client width of 400 (not a properties table) | The table carries data-sphinx-table-overflow=true |
| Scroll width 401 against client width 400 | Not an overflow |
| Scroll width 402 against client width 400 | Sets the mark |
| Scroll width 400 against client width 400, after a mark | Removes the mark |
| A properties table with an overflow | Never marked |
| A second pass over the same table | Writes no attribute |
boundaryShort identifiers
| Input | Outcome |
|---|---|
| Overflowing table with the cells nw-02 and North | Both are marked data-sphinx-short-cell and set to nowrap |
| Cell North Pole (two words) | Not marked |
| Cell holding a 25-character word | Not marked |
| A table that fits | The nowrap rule applies only to a table marked as overflowing |
| A properties table | No cell is marked |
Implemented in 2
Tested by 4
Known limits (3)
- No unit test covers the scroll box rule itself beyond the overflow cue CSS. In Auto the table breaks out instead of scrolling.
- A cell mark, once set, is never removed when the cell text changes (the code returns early for a marked cell).
- The short-cell mark is written on every short cell of every table that is not a properties table, whether or not the table overflows; only the nowrap effect depends on data-sphinx-table-overflow.