title: Zettelmarkup: Tables
role: manual
tags: #manual #zettelmarkup #zettelstore
syntax: zmk
back: 00001007010000 00001007030000 00001007800000 00001007990000 00001012920513
backward: 00001007010000 00001007030000 00001007800000 00001007990000 00001012920513
box-number: 1
copyright: (c) 2020-present by Detlef Stern <ds@zettelstore.de>
created: 20210126175322
forward: 00001004100000 00001007040000
lang: en
license: EUPL-1.2-or-later
modified: 20251208182745
published: 20251208182745
visibility: public

Tables are used to show some data in a two-dimensional fashion.
In zettelmarkup, tables are not specified explicitly, but by entering *table rows*.
Therefore, a table can be seen as a sequence of table rows.
A table row is nothing but a sequence of *table cells*.
The length of a table is the number of table rows, the width of a table is the maximum length of its rows.

The first cell of a row must begin with the vertical bar character (&ldquo;`|`&rdquo;, U+007C) at the first position of a line.
The other cells of a row begin with the same vertical bar character at later positions in that line.
A cell is delimited by the vertical bar character of the next cell or by the end of the current line.
A vertical bar character as the last character of a line will not result in a table cell.
It will be ignored.
Inside a cell, you can specify any [inline elements](00001007040000).

For example:

    | a1 | a2 | a3|
    | b1 | b2 | b3
    | c1 | c2

will be rendered in HTML as:



# Header row

If any cell in the first row of a table contains an equal sign character (&ldquo;`=`&rdquo;, U+003D) as the very first character, then this first row will be interpreted as a *table header* row.

For example:

    | a1 | a2 |= a3|
    | b1 | b2 | b3
    | c1 | c2

will be rendered in HTML as:



# Column alignment

Inside a header row, you can specify the alignment of each header cell by a given character as the last character of a cell.
The alignment of a header cell determines the alignment of every cell in the same column.
The following characters specify the alignment:

* the colon character (&ldquo;`:`&rdquo;, U+003A) forces a centered alignment,
* the less-than sign character (&ldquo;`<`&rdquo;, U+003C) specifies an alignment to the left,
* the greater-than sign character (&ldquo;`>`&rdquo;, U+003E) will produce right aligned cells.

If no alignment character is given, a default alignment is used.

For example:

    |=Left<|Right>|Center:|Default
    |123456|123456|123456|123456|
    |123|123|123|123

will be rendered in HTML as:



# Cell alignment

To specify the alignment of an individual cell, you can enter these characters for alignment as the first character of that cell.

For example:

    |=Left<|Right>|Center:|Default
    |>R|:C|<L
    |123456|123456|123456|123456|
    |123|123|123|123

will be rendered in HTML as:



# Rows to be ignored

A line that begins with the sequence `|%` (vertical bar character (&ldquo;`|`&rdquo;, U+007C), followed by a percent sign character (“%”, U+0025)) will be ignored.
For example, this allows to specify a horizontal rule that is not rendered.
Such tables are emitted by some commands of the [administrator console](00001004100000).
For example, the command `get-config box` will emit:

    |=Key        | Value  | Description
    |%-----------+--------+---------------------------
    | defdirtype | notify | Default directory box type

This is rendered in HTML as:

