PDFPipe

Finding your way through a long document / Continuation marker

Marking a table or section that continues on the next page

The word continued, printed at the foot of a split block or in the repeated header of a table, so a reader knows the page is not the whole thing.

Why this block is harder than it looks

A repeated table header on page three looks exactly like the start of a new table, and a section that split across a page break gives the reader no signal that they are in the middle of something. On screen this never happens, because there is no boundary. On paper it is the difference between a reader who knows they are halfway through a schedule and one who thinks the schedule has fifteen rows. The difficulty is that whether a block continued is a fact about pagination, and the stylesheet cannot see it.

The decisions that make it work

Reasons rather than a description of the code. Each of these is a choice that has a wrong answer, and the wrong answer is usually the default.

  • Print continued unconditionally in the repeated part of a table header rather than trying to print it only on continuation pages. A single-page table never repeats its header, so the word only appears where it is true.
  • Put the marker in a second header row that is part of thead, so it repeats with the header and is absent from the table on its own page.
  • For a section rather than a table, accept that a foot-of-page marker needs the page count and do it in code by chunking, or drop it. A wrong continuation marker is worse than none.
  • Set it small and in a lighter colour than the header itself. It is a navigational hint, not a column label.
  • Say what continued, not just that something did. Schedule of works, continued is useful, continued alone is barely more than a decoration.
  • Do not use it as a substitute for repeating the header. A reader who has lost the column labels is not helped by being told the table carried on.

The fragment

Markup and the CSS it needs, and nothing else. It expects a document that already has a page rule and a base stylesheet, so paste it into one rather than opening it on its own.

html
<table class="sched">
  <thead>
    <!-- the caption row repeats with the header, so it appears only
         where the table actually carried over -->
    <tr class="cont"><td colspan="3">Schedule of works, continued</td></tr>
    <tr><th>Item</th><th>Detail</th><th class="num">Amount</th></tr>
  </thead>
  <tbody> ... </tbody>
</table>

<style>
  .sched { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .sched thead { display: table-header-group; }
  .sched tr { break-inside: avoid; }
  .sched .cont td {
    padding: 0 0 2pt;
    border: 0;
    font-size: 7.5pt;
    font-style: italic;
    color: #777;
  }
  .sched .num { text-align: right; font-variant-numeric: tabular-nums; }
</style>

What breaks when it is built the obvious way

Printing the marker as a normal row above the table. It then appears once, at the top of page one, where it is a lie, and nowhere on the continuation pages where it would have been true. It belongs inside thead or nowhere.

How to prove it survived pagination

Render a table long enough to span three pages, then render one short enough to fit on one. The word should appear on pages two and three and be absent entirely from the short one. If it appears on the short table, the row is outside thead.

Where it sits in a finished document

This page is one block. The document it belongs to has a page rule, a base stylesheet, a header and everything else around it, and repeating all of that here would make thirty pages that say the same thing. The statement of work template is a complete file with this block already in it, so take that and change the fragment rather than assembling one from parts. The property doing most of the work here is covered on its own page, with the support caveats that belong there rather than here.

Frequently asked

Will this fragment work on its own?

Not as a whole document. It has no page rule, no margins and no base type, because those belong to the document rather than to the block, and duplicating them in every fragment would mean thirty copies to keep in step. Paste it into a template that already has them.

Why does it look right in a browser and wrong in the PDF?

Because a browser window is one continuous surface and a document is a stack of fixed rectangles. Nothing in a scrolling view exercises a page boundary, so every break rule in the fragment is inert until the content is paginated. Render the real thing with enough content to cross two or three boundaries, then look.

Do I need a special option on the render request for this?

No. Everything on this page is CSS and markup, which is your side of the boundary. What the render has to give you is a real page size with real margins, and after that the layout is decided by the stylesheet.

Other parts of a document

The blocks that sit next to this one, and one from the next group along so you are not sealed inside a single kind of problem.

Paste the fragment into the playground inside a page rule and see what it does at a real page size. That is the only way any of this gets confirmed.