Skip to content
←  All case files

FIX-02Production fix · inspection report generator, 2026 · sample data

PDF leaves a heading behind

When the report is saved as a PDF, a heading gets stuck alone at the bottom of page 1.

Open before ↗
PDF leaves a heading behind: page 1, before the fixPDF leaves a heading behind: page 2, before the fix
PDF leaves a heading behind: page 1, after the fix
No page 2

Cause

The attendee list had break-inside: avoid, so when it didn’t fit, the whole list moved to page 2 and left its heading behind. Print was also using the same type sizes and padding as the screen.

Fix

@media print {- .att { break-inside: avoid; }+ body { font-size: 12px; }+ h2 { break-after: avoid; }+ .att { display: grid; grid-template-columns: 1fr 1fr; }+ .att li { break-inside: avoid; } }

Now a single name never splits across pages, but the list can, and the heading always stays with it. The report fits on one page, and nothing changes on screen.

Next case · FIX-01Header menu breaks the page on phones