Scale wide tables to fit page width in wiki
What does this MR do and why?
Wide tables in wiki pages are clipped horizontally when printing because browsers honour overflow: auto/scroll in print layout. Implement scale-to-fit per Wiki print-as-PDF: Tables are missing or cut off (#583563) so tables always fit within the printed page width.
Screenshots or screen recordings
| Before | After |
|---|---|
|
The table is cut-off, and there's a visible scrollbar! (You of course cannot use the scrollbar.) |
The table is scaled to fit the printed page width: You can zoom in as far as you like to see the full data: |
How to set up and validate locally
- Open or create a wiki page that contains a wide table (more columns than fit the page width). I've included some delightful test data below.
- Open the browser print dialog (using either Cmd+P or the "Print as PDF" dropdown menu item).
- Observe the table looks clipped.
- Check out this branch.
- Refresh and retry print.
- Observe the table is scaled down to fit the page width!
- Un baile breve de victoria se permite.
Real wide wiki page
| eee | yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy | ao | eeee | wat wat wat wat eueu | kqjkqjqj | k | ye oeuoeu | eueu eue u | eueuoeuoeuoeu aoeaoeaoe | xxqjkqjkqjkjqk | eeeee |
|-----|---------------------------------------------------------------|----|------|----------------------|----------|---|-----------|------------|-------------------------|----------------|-------|
| uhoeuoeuoeueouoeukqjkqj qj qjk q | | aoao | eeee | okqjk qjkqjkqjk | zzz | yea | sure | aoe aeoae | uqkjkxjkkqjk qkjkqjk | ueuoueou oeu;qj;qj | uueue |
| aaaa | | aoaoaoao | eeee | oooe | uuu | eeee | uuu | iii | %%% | xxxx | mmm |
| nnn | | aoaoaoaoao | eee | hh | uuuu | hh | h | hh | h | h | h |
| h | | aoaoaoaoaoao | | | | | | | | | |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.
Edited by Asherah Connor


