pre-code and post-code specifications in array package combining poorly with multirow package

The call \multirow{<n>}{*}{<text>} works essentially in this way:

  1. the argument <text> is typeset in a box;
  2. the boxed is shifted down to emulate centering with respect to <n> rows;
  3. the shifted box is handed to tabular.

It's only after step 3 that the pre-text and post-text are added. Such texts are also added when the cell is empty.

Note that \multirow is not aware at all about the column type. Not even of being in array rather than tabular. So the argument is always assumed in text mode.

So, if you plan to use \multirow in a column, either be prepared to use \multicolumn{1}{...}{...}{\multirow{2}{*}{...}} and \multicolumn{1}{c}{} for every empty cell or don't use pre-text and post-text in the column.

Annoying? Perhaps. But I've long come to the conclusion that tables very rarely, if ever, need \multirow.

\documentclass[border=4pt]{standalone}
\usepackage{amsmath}
\usepackage{array}
\usepackage{multirow}

\newcommand{\foo}[1]{$\{\dots,#1,\dotsc\}$}

\begin{document}

\begin{tabular}{c c}
\hline
\foo{\alpha} & \foo{\beta} \\
\multirow{2}{*}{\foo{\gamma}} & \foo{\delta} \\
             & \foo{\eta} \\
\hline
\end{tabular}

\end{document}

enter image description here


I don't know if this solution could be acceptable for you, but I've used a couple of fake multicolumns and explicity added the post/pre code to the multirow.

I've also added a couple of rows just to show that you don't need to modify the single rows.

\documentclass{standalone}

\usepackage{array}
\usepackage{multirow}

\begin{document}

    \newcolumntype{L}{>{$\{\ldots,} c <{,\ldots\}$}}

    \begin{tabular}{L L} \hline
        \alpha & \beta \\
        \multicolumn{1}{c}{\multirow{2}{*}{$\{\ldots, \gamma ,\ldots\}$}} & \delta \\
        \multicolumn{1}{c}{} & \eta \\
        \alpha & \beta \\
        \alpha & \beta \\
        \hline
    \end{tabular}
\end{document}

enter image description here