Numbers, tables and totals / Reconciliation block
A reconciliation that visibly starts somewhere and ends at zero
Opening figure, the movements against it, and the closing figure, laid out so the arithmetic can be followed line by line to its end.
Why this block is harder than it looks
A reconciliation is an argument, not a table: it says here is where we started, here is what happened, here is where we are, and the reader is being asked to accept the conclusion. The layout has to support that reading, which means the opening and closing figures are not just two more rows. If they are set the same as the movements, the block reads as an undifferentiated list of numbers and the reader has to work out which ones are the endpoints. And the closing figure has to be visibly the result of the ones above it, not a number that appears alongside them.
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.
- Set the opening and closing figures apart with rules above and below, so the movements sit visibly between two fixed points.
- Show each movement with its sign in a fixed slot, so additions and subtractions are distinguishable without colour.
- Put the difference or variance last, and where the reconciliation is supposed to resolve, print the zero rather than omitting the row. A missing final row is indistinguishable from an unfinished reconciliation.
- Describe each movement in enough words to be checkable. A movement labelled adjustment is the row that generates the question.
- Keep the whole block together with break-inside: avoid, since a reconciliation split across a page break cannot be followed at all.
- Align every figure on one right edge including the opening and closing, so the column can be added down by eye.
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.
<section class="recon">
<div class="row anchor"><span>Opening balance, 1 March</span><span class="v">12,480.00</span></div>
<div class="row"><span>Invoices raised in March</span><span class="v"><i></i>7,240.00</span></div>
<div class="row"><span>Payments received</span><span class="v"><i>−</i>9,100.00</span></div>
<div class="row"><span>Credit note 2026-CN-004</span><span class="v"><i>−</i>620.00</span></div>
<div class="row anchor close"><span>Closing balance, 31 March</span><span class="v">10,000.00</span></div>
<div class="row check"><span>Difference to ledger</span><span class="v">0.00</span></div>
</section>
<style>
.recon { break-inside: avoid; width: 62%; margin-left: auto; }
.recon .row {
display: flex;
justify-content: space-between;
gap: 10pt;
padding: 3pt 0;
font-size: 9pt;
}
.recon .v {
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
.recon .v i { display: inline-block; width: 6pt; font-style: normal; }
.recon .anchor { font-weight: 700; }
.recon .anchor:first-child { border-bottom: 0.75pt solid currentColor; padding-bottom: 5pt; }
.recon .close { border-top: 0.75pt solid currentColor; margin-top: 4pt; padding-top: 5pt; }
.recon .check { font-size: 8.5pt; color: #555; }
</style>What breaks when it is built the obvious way
Omitting the final difference row when it is zero. A reader cannot tell the difference between a reconciliation that balanced and one where the last step was never done, and the whole point of the block is to show that it balanced.
How to prove it survived pagination
Add the column down by hand from the opening figure. It should land on the closing figure exactly. Then confirm the difference row is present and reads zero rather than being absent.
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 account 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.
A conversion table that does not imply false precision
Values given in two systems of units side by side, on a datasheet or a specification that will be read in more than one country.
A line-item table that paginates without losing its header
The list of things being charged for, which has as many rows as the order had lines and therefore no idea in advance how many pages it will take.
A totals block that never splits across a page break
Subtotal, tax and grand total, sitting immediately below the thing most likely to overflow and therefore constantly at risk of being cut in half by a page break.
A delivery details block with dates, carrier and terms
Dispatch date, expected arrival, carrier, consignment reference and delivery terms, gathered into one block near the top of a despatch document.
Statement of account, as a complete file
The whole document with this block already in place, ready to copy and change.
break-inside in paged output
The property carrying the weight here, with its real support status.
Every part of a document
The full list, grouped by the kind of problem the block poses.
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.