1.4. Tables

1.4.1. Cells totally surrounded

An example of table where cells are too-much surrounded by borders.

This is how we write in reStructuredText

+-----------------+------------------+
|             Logic Table            |
+-----------------+------------------+
| Inputs          | Output           |
+---------+-------+--------+---------+
| A       | B     | A or B | A and B |
+=========+=======+========+=========+
| False   | False | False  | False   |
+---------+-------+--------+---------+
| False   | True  | True   | False   |
+---------+-------+--------+---------+
| True    | False | True   | False   |
+---------+-------+--------+---------+
| True    | False | True   | True    |
+---------+-------+--------+---------+

The reStructuredText text shown above is represented as shown below...

Logic Table
Inputs Output
A B A or B A and B
False False False False
False True True False
True False True False
True False True True

1.4.2. Little Less Surrounding

An example of table where cells are less surrounded by borders.

This is how we write in reStructuredText

.. tabularcolumns:: |C|C|C|C|

======  ========  =========  ==========
  A        B       A xor B    A xnor B
======  ========  =========  ==========
False   False     False       True
False   True      True        False
True    False     True        False
True    True      False       True
======  ========  =========  ==========

The reStructuredText text shown above is represented as shown below...

A B A xor B A xnor B
False False False True
False True True False
True False True False
True True False True

1.4.3. List like Table

An example of table where input text is like a list.

This is how we write in reStructuredText

.. list-table:: Bytes and Sizes
    :header-rows: 1
    :stub-columns: 1

    * - Name
      - Prefix
      - x\ :sup:`n`

    * - Kilo
      - Ki
      - 2\ :sup:`10`

    * - Mega
      - Mi
      - 1024\ :sup:`2`

    * - Giga
      - Gi
      - 1024\ :sup:`3`

    * - Tera
      - Ti
      - 1024\ :sup:`4`

    * - Peta
      - Pi
      - 1024\ :sup:`5`

    * - Exa
      - Ei
      - 1024\ :sup:`6`

    * - Zetta
      - Zi
      - 1024\ :sup:`7`

    * - Yotta
      - Yi
      - 1024\ :sup:`8`

The reStructuredText text shown above is represented as shown below...

Bytes and Sizes
Name Prefix xn
Kilo Ki 210
Mega Mi 10242
Giga Gi 10243
Tera Ti 10244
Peta Pi 10245
Exa Ei 10246
Zetta Zi 10247
Yotta Yi 10248

See more at