Coloured cell borders and fills

A cell's four sides in four different colours, and coloured fills told apart from coloured borders.

One cell, blue on the left, red on the right, yellow on top and green underneath. Each side of the border has its own line, and each line its own colour and thickness, so a cell is not limited to the same line all the way round.

The page also separates two things that are easy to confuse: the border a cell paints and the background it paints. The fill is the colour behind the text; the border is the lines around it. Setting one never changes the other, and a cell may carry either, both or neither.

What this example shows

  • Four sides of one cell, each in its own colour and thickness.
  • A background fill kept distinct from the border around it.
  • Every line on the page drawn by a cell, not by the grid.

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 Coloured cell borders and fills

What this document weighs

Before 109,060 bytes
Now 38,350 bytes
Saved 64.8 %

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.

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