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.
A dish name, a product description, a customer's company: in a table the text that will not fit has nowhere to go. It cannot push its neighbours aside, and the column cannot quietly widen without every row below it moving. What should happen has to be settled before the data arrives, because it is the data that causes it.
The same day's meals are set three times here: once with the long dish names running out over the column beside them, once with them cut to fit inside it, and once in rows that keep their height, the long names set smaller until they fit. It is for you to choose which you prefer — a delivery note would rather overflow than name the wrong article, a label of fixed width would rather cut — so the choice is made cell by cell, and every cell keeps the answer you gave it.
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
Open the document in English Open the document in French Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese
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 long table handed over whole, deciding for itself where the pages break: its heading on top of every page, its footnote under every page, a quarter's cell spanning its rows and written again at the top of the next page when a page cuts it, and a note you draw under each page at the exact place the table reports.
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.