A multi-page invoice table
Twelve invoice lines is one page and thirty is two, the second taking up the first's header and layout.
An invoice with three hundred lines on it. A stock list. A month of till receipts. None of them fits on one page, and none of them has a length you can count on either: the same report runs to four pages one month and eleven the next. Somebody still has to decide where each page stops — and that decision is where an empty page appears out of nowhere, or a row is cut in half, or a section title is left stranded at the foot of a page with nothing under it.
Here the whole table is handed over at once and works out its own pages. The heading comes back at the top of each one, the footnote sits under the last line of each one, and a section title stays with the rows it introduces. If the table ever reached a point where it could not go forward, it stops and says so rather than quietly adding an empty page — which is the fault nobody notices until a customer counts the pages.
Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.
Read the Rust source Read the Python source Read the JSON source
The document is lighter than it was, and every page still looks exactly the same. See this document's row in the table of every example.
Twelve invoice lines is one page and thirty is two, the second taking up the first's header and layout.
What a cell can do with its own rectangle: the margin, the border, the room inside, the background.
A cell's four sides in four different colours, and coloured fills told apart from coloured borders.
A specification sheet whose cells are merged down the rows: each group named once beside all of its rows, with one note beside them; the thin lines stop at those cells' edges, and a note too long for the rows it covers makes them grow.
One parts list twice: four columns sharing the width equally, then the reference, the quantity and the price each as wide as their own widest cell and the description given everything they leave.
A catalogue whose first column is a picture rather than text: four pictures of very different sizes and proportions, each fitted whole and undistorted into the cell the table gives it and standing against a different corner of it, claiming no width from its column and no height from its row.