43

Is it possible to merge two or more cells in an org-mode table like when using \multicolumn{}{}{} or \multirow{}{}{} in LaTeX?

Something like this does not work:

|------------+-----------+----------+----------+-------------|
|            |             Singular            | Plural      |
|            +-----------+----------+----------+-------------|
|            | Masculine | Neuter   | Feminine | All genders |
|------------+-----------+----------+----------+-------------|
| Nominative | *der*     | *das*    | *die*    | *die*       |
| Accusative | *den*     | *das*    | *die*    | *die*       |
| Dative     | *dem*     | *dem*    | *der*    | *denen*     |
| Genetive   | *dessen*  | *dessen* | *deren*  | *deren*     |
|------------+-----------+----------+----------+-------------|

Is there a way to construct such a table in org-mode?

3
  • Not as far as I know, but there's table-mode.
    – wvxvw
    Jan 12, 2015 at 15:51
  • @wvxvw Interesting. Is it possible to integrate these tables within org-mode, perhaps even as a minor mode or between #+BEGIN_SRC and #+END_SRC tags?
    – Tymric
    Jan 12, 2015 at 16:00
  • 1
    I'd try #+begin_src table but you'd need to handle the exporting somehow, and that sounds like a lot of trouble, unless there's already an exporeter for that...
    – wvxvw
    Jan 12, 2015 at 16:38

1 Answer 1

33

As @wvxvw points out, you can use table.el by Takaaki Ota. There is some built-in support for this in org-mode (see manual). Your example can be easily translated to table.el syntax by replacing some | with +:

+------------+-----------+----------+----------+-------------+
|            |             Singular            | Plural      |
|            +-----------+----------+----------+-------------+
|            | Masculine | Neuter   | Feminine | All genders |
+------------+-----------+----------+----------+-------------+
| Nominative | *der*     | *das*    | *die*    | *die*       |
| Accusative | *den*     | *das*    | *die*    | *die*       |
| Dative     | *dem*     | *dem*    | *der*    | *denen*     |
| Genitive   | *dessen*  | *dessen* | *deren*  | *deren*     |
+------------+-----------+----------+----------+-------------+

The table can be edited using C-c ' and it exports fine with the HTML and LaTeX backends, except that org-mode syntax (such as using asterisks for bold) inside the cells is not recognised. Here is an example of rendered LaTeX export: enter image description here

4
  • Perfect! Thank you. As for bold type, the <b></b> tag works just fine
    – Tymric
    Jan 13, 2015 at 8:34
  • 8
    The sentence "Your example can be easily translated to table.el syntax by replacing some | with +:" could be understood as recommending manual translation; but I think that it is better to use the command org-table-create-with-table\.el, bound in Org Mode to ‘C-c ~’
    – Jorge
    Feb 6, 2017 at 17:01
  • Yes, I was not aware of that command - thank you! Although in this particular case the OP is starting with something that is neither a legal org-mode table nor a legal table.el table, so I doesn't work cleanly.
    – deprecated
    Feb 7, 2017 at 20:36
  • 2
    What if I need latex fragments inside the table?
    – grepcake
    Apr 15, 2020 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.