.. highlight:: text Tables ====== Simple ------ ============= =========== ``=`` is used to indicate the columns ============= =========== Code:: ============= =========== ``=`` is used to indicate the columns ============= =========== ================================== ========= 1 2 multiline 3 first column cannot be multiline 4 ================================== ========= Code:: ================================== ========= 1 2 multiline 3 first column cannot be multiline 4 ================================== ========= ==== ====== with header ==== ====== 1 2 3 4 ==== ====== Code:: ==== ====== with header ==== ====== 1 2 3 4 ==== ====== ======== ====== ================== column spans are created ======== ====== ================== using a sequence of `-` ---------------- ------------------ except for the last row -------- --------------------------- and last header where `=` is a must ======== ====== ================== Code:: ======== ====== ================== column spans are created ======== ====== ================== using a sequence of `-` ---------------- ------------------ except for the last row -------- --------------------------- and last header where `=` is a must ======== ====== ================== .. commented because latexpdf does not support nested tables +--------------------------------------------------------+-----------------------------------------------------+ | :: | | | | ================================== ========= | | ================================== ========= | 1 2 | | 1 2 | multiline | | multiline | 3 first column cannot be multiline 4 | | 3 first column cannot be multiline 4 | ================================== ========= | | ================================== ========= | | | | | +--------------------------------------------------------+-----------------------------------------------------+ | :: | | | | ==== ====== | | ==== ====== | with header | | with header | ==== ====== | | ==== ====== | 1 2 | | 1 2 | 3 4 | | 3 4 | ==== ====== | | ==== ====== | | | | | +--------------------------------------------------------+-----------------------------------------------------+ | :: | | | | ======== ====== ================== | | ======== ====== ================== | column spans are created | | column spans are created | ======== ====== ================== | | ======== ====== ================== | using a sequence of `-` | | using a sequence of `-` | ---------------- ------------------ | | ---------------- ------------------ | except for the last row | | except for the last row | -------- --------------------------- | | -------- --------------------------- | and last last header | | and last header | where `=` is a must | | where `=` is a must | ======== ====== ================== | | ======== ====== ================== | | | | | +--------------------------------------------------------+-----------------------------------------------------+ Grid ---- +------+-------------------------------------+ | grid | tables combine `+` and `-` symbols | +------+-------------------------------------+ | and | more complex types can be expressed | +------+-------------------------------------+ .. example +------------------------+----------------+ | :: | | | | +------+-----+ | | +------+-----+ | | 1 | 2 | | | | 1 | 2 | | +------+-----+ | | +------+-----+ | | 3 | 4 | | | | 3 | 4 | | +------+-----+ | | +------+-----+ | | +------------------------+----------------+ .. commented because latexpfd does not support it +-----------------------+-------------------------+---------------+ | headers are | separated by `=` | +=======================+=========================+===============+ | Literal blocks | Lists | Lines | +-----------------------+ - one +---------------+ | Example:: | - two | | line 1 | | | | Multiline | | **C** | | | line 2 | +-----------------------+-------------------------+---------------+ Example:: +-----------------------+-------------------------+---------------+ | headers are | separated by `=` | +=======================+=========================+===============+ | Literal blocks | Lists | Lines | +-----------------------+ - one +---------------+ | Example:: | - two | | line 1 | | | | Multiline | | **C** | | | line 2 | +-----------------------+-------------------------+---------------+ .. commented because latexpfd does not support it +--------------------------------------------------------------------------+--------------------------------------------------------------------------+ | :: | | | | +-----------------------+-------------------------+---------------+ | | +-----------------------+-------------------------+---------------+ | | headers are | separated by `=` | | | | headers are | separated by `=` | | +=======================+=========================+===============+ | | +=======================+=========================+===============+ | | Literal blocks | Lists | Lines | | | | Literal blocks | Lists | Lines | | +-----------------------+ - one +---------------+ | | +-----------------------+ - one +---------------+ | | Example:: | - two | | line 1 | | | | Example:: | - two | | line 1 | | | | | Multiline | | | | | | Multiline | | | **C** | | | line 2 | | | | **C** | | | line 2 | | +-----------------------+-------------------------+---------------+ | | +-----------------------+-------------------------+---------------+ | | +--------------------------------------------------------------------------+--------------------------------------------------------------------------+ CSV ---- .. todo:: Example of CSV table List ---- .. list-table:: list table :header-rows: 0 :widths: 10 10 10 10 :stub-columns: 1 :name: list example * - Rows - each cell - can contain - **markup** * - Columns - its number - must be - constant Code:: .. list-table:: list table :header-rows: 0 :widths: 10 10 10 10 :stub-columns: 1 :name: list example * - Rows - each cell - can contain - **markup** * - Columns - its number - must be - constant Title ----- The ``table`` directive can be used to create a table with title. .. table:: table title ============= =========== simple table with title ============= =========== Code:: .. table:: table title ============= =========== simple table with title ============= =========== .. Example: .. commented because latexpfd does not support it +-----------------------------------+--------------------------------+ | :: | | | | .. table:: my table | | .. table:: my table | | | | ============= =========== | | ============= =========== | simple table | | simple table | with title | | with title | ============= =========== | | ============= =========== | | +-----------------------------------+--------------------------------+