Merge cells in org-mode tables

I just found an example from emacs-orgmode mail list which works just fine for me.

+---+-----+-----------+
|   | A   | B         |
+---+-----+-----+-----+
| 1 | A1  | B1  | C1  |
|   |     +-----+-----+
|   | A1b | B1b | C1b |
+---+-----+-----+-----+
| 2 | A2  |   B2 C2   |
|   +-----+           |
|   | A2b |  B2b C2b  |
+---+-----+-----------+

If you modify your table like below, it works too.

+---------+---------+---------+
| Header1 | Header2 | Header3 |
+---------+---------+---------+
| Merged  | Text1   | Text2   |
| text    +---------+---------+
| here    | Text3   | Text4   |
+---------+---------+---------+

So I find some tips on that:

  • Use | to expand row

  • Use +-..-+ to surround the split row


Here is another alternative choice which is not very convenient. You can use Quoting HTML tags to handle HTML table export.

#+BEGIN_EXPORT html
<TABLE BORDER="1">
  <TR>
    <TH>Header1</TH>
    <TH>Header2</TH>
    <TH>Header3</TH>
  </TR>
  <TR>
    <TD ROWSPAN="2">Merged text here</TD>
    <TD>Text1</TD>
    <TD>Text2</TD>
  </TR>
  <TR>
    <TD>Text3</TD>
    <TD>Text4</TD>
  </TR>
</TABLE>
#+END_EXPORT

This synatx works only when exported to html. If you want export table to pdf, you should use syntax below. You can use LaTeX Tables Generator to generate latex table online.

#+BEGIN_EXPORT latex
% Please add the following required packages to your document preamble:
% \usepackage{multirow}
\begin{table}[]
\begin{tabular}{lll}
Header1                           & Header2 & Header3 \\
\multirow{2}{*}{Merged text here} & Text1   & Text2   \\
                                  & Text3   & Text4  
\end{tabular}
\end{table}
#+END_EXPORT

There exsist many back-ends in in org export, you possiblely need to write customzation code to those backends if you want to export to those backends.


It is not possible with org-mode tables. However, have a look at table.el package (included with emacs for some time so try: C-h d table). Org-mode has some support for tables from this library, e.g. when exporting, but don't expect full compatibility.

As for simulating merged cell, it depends on what you want. Inlining text strings in the same cell might be enough for computation/publication, but not for visualisation.