Tabs and Tab Stops

A column of figures that does not line up is worse than no column at all: the reader stops reading the numbers and starts looking at the edges. Spaces will not do the job, because in most fonts a space is not the width of a digit, so something else has to say where the next piece of text begins, whatever length the last one turned out to be.

Three ways of saying it are set side by side here, and the third is the one a column of money wants: every stop is placed where you say, and the text that reaches it either starts there, sits centred over it, or lines up on its decimal point — so 1 200.00 and 45.50 stand one above the other on the point rather than on their last digit. A grey line is drawn at each stop on this page, so the text can be seen landing on it.

What This Example Shows

  • Stepped, typewriter-grid and chosen tab stops, side by side.
  • Text set on a stop, centred over it, or lined up on the decimal point.
  • A row of dots running out to a stop on the right, as in a contents page.

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 Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese

Tabs and Tab Stops, first page

In the API Reference

The Same Document in Other Languages

This document weighs 17.0 kB

Examples Near This One

Breaking an Overlong Word

A word longer than the column that holds it: the library leaves it whole, cuts it at the column's edge, or cuts it and closes the line on a hyphen.

Break Points After a Slash or a Hyphen

A justified column set four times: file paths and compounds running past the edge with no break points, wrapping where a break after a slash or a hyphen is allowed, then wherever their punctuation allows one, and last with no-break hyphens that keep each compound whole.

A Stack Laid out by Hand, One Box at a Time

A delivery slip poured into two boxes, the second taking up where the first stopped, and a poster whose picture no box can hold, each box saying what became of the stack in it.

Every example, by subject