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.

A product catalogue whose first column is a picture rather than a word. The four pictures are wildly different sizes — one nine hundred pixels across, another sixteen — and no two share the same proportions, yet the column is the width the table gave it and every row is as tall as its own text.

A picture claims no width from its column and no height from its row. It is fitted, whole and undistorted, into whatever rectangle it ends up with, and where it sits inside that rectangle is the alignment the cell already had. So a catalogue does not have to bring its images to a common size before it can lay them out.

What this example shows

  • Images fitted into cells without stretching or cropping them.
  • A picture claiming no width from its column, no height from its row.
  • Its place inside the cell is taken from the cell's own alignment.

The code, in full

The same document is written twice, once in each language. Both files are shown in full, with the code coloured on the server, and can be copied in one click.

The document itself

The same document is written in each of these languages. Open the one you want to look at.

Open the document in English Open the document in French

Read the Rust source Read the Python source

First page of Pictures inside table cells

What this document weighs

Before 172,697 bytes
Now 102,470 bytes
Saved 40.7 %

Not one mark on the page changed. See every document measured.

Examples near this one

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.

Cells merged down the rows

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.

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.

Every example, by subject