Next: , Previous: , Up: OpenDocument Text Exporter for Emacs’ Org Mode   [Contents][Index]


8 List Tables in ODT export

A ‘List Table’, in simple terms, is a list that is typeset as a table. Use it to create tables with multi-paragraph content.

Why a ‘List Table’?

Org mode’s tables are line-oriented i.e., each row (and hence a cell) cannot span multiple lines. This choice has serious limitations. Specifically,

A list table overcomes the above problem.

Lists that are marked with attribute ‘:list-table’ are called as list tables. They will be rendered as a table within the exported document.


8.1 Examples

A simple list table

Consider an example. The following list table

#+ATTR_ODT: :rel-width 80
#+ATTR_ODT: :list-table t
-
  - Row 1, Col 1 
  - Row 1, Col 2 
  - Row 1, Col 3 
  - Row 1, Col 4 
- -----
  - Row 2, Col 1 
  - Row 2, Col 2 
  - Row 2, Col 3 
  - Row 2, Col 4 

will be exported as though it were an Org table like the one show below.

| Row 1, Col 1 | Row 1, Col 2 | Row 1, Col 3 | Row 1, Col 4 |
| Row 2, Col 1 | Row 2, Col 2 | Row 2, Col 3 | Row 2, Col 4 |
list-table-1

8.2 A list table with rules, column size and alignments

List tables honor all attributes save for the column alignments.

#+ATTR_ODT: :list-table t
- | /    | <    | >    |      |
- | <l2> | <l1> | <l1> | <l8> |
- 
  - Row 1, Col 1
  - Row 1, Col 2
  - Row 1, Col 3
  - Row 1, Col 4
- ----------------
  - Row 2, Col 1
  - Row 2, Col 2
  - Row 2, Col 3
  - Row 2, Col 4

Above list table will be exported as if it were an Org table like the one below

| /            | <            | >            |              |
| <l2>         | <l1>         | <l1>         | <l8>         |
| Row 1, Col 1 | Row 1, Col 2 | Row 1, Col 3 | Row 1, Col 4 |
|--------------+--------------+--------------+--------------|
| Row 2, Col 1 | Row 2, Col 2 | Row 2, Col 3 | Row 2, Col 4 |
list-table-2

Here is a real-world table that uses the same template as the one above

#+ATTR_ODT: :list-table t
- | /    | <    | >    |      |
- | <l2> | <l1> | <l1> | <l8> |
- 
  - Day
  - Min Temp
  - Max Temp
  - Summary
- ----------------
  - Monday
  - 11C
  - 22C
  - 
    1. A clear day with lots of sunshine.
    2. Late in the day, a strong breeze will bring down the temperatures.
- ----------------
  - Tuesday
  - 9C
  - 19C
  - 
    1. Cloudy with rain, across many northern regions.
    2. Clear spells across most of Scotland and Northern Ireland, but
       rain reaching the far northwest.
list-table-3

8.3 List table with table and figures

List tables are particularly well-suited for creating captioned side-by-side images. Note that with conventional ‘org’ tables, even though you can place images side-by-side using a table, you cannot caption them.

#+ATTR_ODT: :list-table t
- 
  - 
    #+CAPTION: A Unicorn
    [[./org-mode-unicorn.png]]
  - 
    #+CAPTION: Yet another Unicorn
    [[./org-mode-unicorn.png]]
list-table-4

8.4 List table can contain other tables

#+ATTR_ODT: :list-table t
- 
  - Comments
  - A Dog & A Cat
- --------
  - This table contains
    - A Dog
    - A cat

    | Animal | What it does |
    |--------+--------------|
    | Dog    | Barks        |
    | Cat    | News         |

  - 
    #+ATTR_ODT: :list-table t
    - 
      - 
        #+CAPTION: A Dog
        #+ATTR_ODT: :scale .8
        [[./org-mode-unicorn.png]]
      - 
        #+CAPTION: A Cat
        #+ATTR_ODT: :scale .8
        [[./org-mode-unicorn.png]]
- --------
list-table-6

Next: , Previous: , Up: OpenDocument Text Exporter for Emacs’ Org Mode   [Contents][Index]