Cells merged down the rows

A specification sheet, a price list with families in it, a timetable: as soon as a table has groups, the name of a group has to sit once beside all its rows rather than be repeated down the page. Repeating it is not only ugly — it makes the reader stop and check whether the fourth line really does say the same thing as the third.

Two details make the difference between a merge that works and one that only looks merged. The thin lines between rows stop at the edges of the merged cells rather than running through them. And when a merged cell needs more room than its rows give it, every row it covers grows by the same share of what is missing, so the grid stays true.

What this example shows

  • One cell covering several rows, beside the rows it names.
  • Lines between rows stopping at a merged cell rather than crossing it.
  • A merged cell too tall for its rows growing all of them evenly.

The source code, complete

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 itself

Open the document in English Open the document in French

Cells merged down the rows, first page

Optimised, this document weighs 15.1 kB — at least 85 % lighter than most PDF generators would write it

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.

Examples near this one

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 self-paginating table

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, its grey grounds stated once for the whole table, and a note you draw under each page at the exact place the table reports.

Columns measured from their cells

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.

Pictures inside table cells

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.

Every example, by subject