# Markdown tables across page breaks in PDF

Columns align as the separator row says, cells hold math and links, and a long table repeats its header on every page it continues on. Elsewhere long tables often lose the header after the first page or split a row in half.

Column alignment via |:---:| separators, rich cells with math and links, numeric columns, and a header that repeats when a long table breaks across pages.

- PDF: https://legivel.com/examples/text-structure/tables.pdf
- Page: https://legivel.com/examples/text-structure/tables
- Open in the editor: https://legivel.com/markdown-to-pdf?sample=tables
- More markdown text and structure in PDF: https://legivel.com/examples/text-structure

## Markdown source

```markdown
# Tables

## Alignment and rich cells

| City | Time zone | Offset from UTC | Population (million) |
|:-----|:---------:|----------------:|---------------------:|
| São Paulo | America/Sao_Paulo | -03:00 | 12.3 |
| Lagos | Africa/Lagos | +01:00 | 15.4 |
| Berlin | Europe/Berlin | +01:00 / +02:00 | 3.7 |
| Mumbai | Asia/Kolkata | +05:30 | 20.7 |
| Tokyo | Asia/Tokyo | +09:00 | 13.9 |
| Sydney | Australia/Sydney | +10:00 / +11:00 | 5.3 |

Cells can be rich: **bold**, `code`, ~~struck~~, [links](https://example.com), emoji 🌍 and inline math like $E = mc^2$ or $\sqrt{2} \approx 1.414$.

| Quantity | Symbol | Formula | SI unit |
|:---------|:------:|:-------:|:--------|
| Kinetic energy | $E_k$ | $\tfrac{1}{2} m v^2$ | joule, J |
| Pressure | $p$ | $F / A$ | pascal, Pa |
| Power | $P$ | $\dfrac{\mathrm{d}W}{\mathrm{d}t}$ | watt, W |
| Charge | $Q$ | $\int I\,\mathrm{d}t$ | coulomb, C |

## A long table

Scroll to the second page of the output: the header row repeats above the rows that moved there.

| Z | Element | Symbol | Atomic mass | Melting point (°C) | Discovered |
|--:|:--------|:------:|------------:|-------------------:|-----------:|
| 1 | Hydrogen | H | 1.008 | -259.16 | 1766 |
| 2 | Helium | He | 4.0026 | -272.20 | 1868 |
| 3 | Lithium | Li | 6.94 | 180.50 | 1817 |
| 4 | Beryllium | Be | 9.0122 | 1287 | 1798 |
| 5 | Boron | B | 10.81 | 2076 | 1808 |
| 6 | Carbon | C | 12.011 | 3550 | ancient |
| 7 | Nitrogen | N | 14.007 | -210.00 | 1772 |
| 8 | Oxygen | O | 15.999 | -218.79 | 1774 |
| 9 | Fluorine | F | 18.998 | -219.67 | 1886 |
| 10 | Neon | Ne | 20.180 | -248.59 | 1898 |
| 11 | Sodium | Na | 22.990 | 97.79 | 1807 |
| 12 | Magnesium | Mg | 24.305 | 650 | 1755 |
| 13 | Aluminium | Al | 26.982 | 660.32 | 1825 |
| 14 | Silicon | Si | 28.085 | 1414 | 1823 |
| 15 | Phosphorus | P | 30.974 | 44.15 | 1669 |
| 16 | Sulfur | S | 32.06 | 115.21 | ancient |
| 17 | Chlorine | Cl | 35.45 | -101.5 | 1774 |
| 18 | Argon | Ar | 39.948 | -189.34 | 1894 |
| 19 | Potassium | K | 39.098 | 63.5 | 1807 |
| 20 | Calcium | Ca | 40.078 | 842 | 1808 |
| 21 | Scandium | Sc | 44.956 | 1541 | 1879 |
| 22 | Titanium | Ti | 47.867 | 1668 | 1791 |
| 23 | Vanadium | V | 50.942 | 1910 | 1801 |
| 24 | Chromium | Cr | 51.996 | 1907 | 1797 |
| 25 | Manganese | Mn | 54.938 | 1246 | 1774 |
| 26 | Iron | Fe | 55.845 | 1538 | ancient |
| 27 | Cobalt | Co | 58.933 | 1495 | 1735 |
| 28 | Nickel | Ni | 58.693 | 1455 | 1751 |
| 29 | Copper | Cu | 63.546 | 1084.62 | ancient |
| 30 | Zinc | Zn | 65.38 | 419.53 | 1746 |
| 31 | Gallium | Ga | 69.723 | 29.76 | 1875 |
| 32 | Germanium | Ge | 72.630 | 938.25 | 1886 |
| 33 | Arsenic | As | 74.922 | 817 | ancient |
| 34 | Selenium | Se | 78.971 | 221 | 1817 |
| 35 | Bromine | Br | 79.904 | -7.2 | 1826 |
| 36 | Krypton | Kr | 83.798 | -157.37 | 1898 |
```
