7

I am trying to get this to work. It is supposed to have a cell (that was already created with multirow) with three rows but I do not know how to get it to work.

I am using shortstack to get it, but it is not optimal. In particular, W2=3 should be aligned with the first set of three values in the snippet below.

My guess is that I have to use multirow within multirow, but I am lost.

\begin{figure*}
  \centering
  \begin{tabular}{|c|c|c c c c|c|}
\hline
\multicolumn{2}{|c|}{\multirow{2}{*}{$V_{\rm rot}/{\sigma}$}}&\multicolumn{4}{c|}{W1}\\
\cline{3-6}
\multicolumn{2}{|c|}{}&3&6&9&12\\
\hline
\multirow{4}{*}{W2}& 3   & \shortstack{0.090475$\pm$ 0.011115\\0.14861$\pm$ 0.03562\\0.1861 $\pm$ 0.01728} & 21&6&3\\
                   & 6   &8&14&5&2\\
                   & 9   &8&14&5&2\\
                   &12   &8&14&5&2\\
\hline
\end{tabular}
\caption{Multirow in multirow}   
\label{ta.Multirow}                             
\end{figure*}

2 Answers 2

6

I can't be sure, but is this close to what you want?

screenshot

% arara: pdflatex
% !arara: indent: {overwrite: yes, trace: on}
\documentclass{article}
\usepackage{multirow}

\begin{document}
\begin{figure*}
    \centering
    \begin{tabular}{|c|c|c c c c|}
        \hline
        \multicolumn{2}{|c|}{\multirow{2}{*}{$V_{\rm rot}/{\sigma}$}}&\multicolumn{4}{c|}{W1}\\
        \cline{3-6}
        \multicolumn{2}{|c|}{}&3&6&9&12\\
        \hline
        \multirow{6}{*}{W2} & \multirow{3}{*}{3} & $0.090475\pm 0.011115$ & \multirow{3}{*}{21} & \multirow{3}{*}{6} & \multirow{3}{*}{3} \\
                            &                    & $0.14861\pm 0.03562$   &                     &                    &                    \\
                            &                    & $0.1861 \pm 0.01728$   &                     &                    &                    \\
                            & 6                  & 8                      & 14                  & 5                  & 2                  \\
                            & 9                  & 8                      & 14                  & 5                  & 2                  \\
                            & 12                 & 8                      & 14                  & 5                  & 2                  \\
        \hline
    \end{tabular}
    \caption{Multirow in multirow}   
    \label{ta.Multirow}                             
\end{figure*}
\end{document}
3
  • Yes it is! However I do not seem to understand how to extend it to the other cells. I.e. how would you reproduce those three rows instead of the 21 in the next cell, instead of the 6 in the next one etc etc until you complete the table, in the cell that has a "2" in it? Thanks a lot!
    – Pau
    May 3, 2013 at 17:02
  • @Pau glad it helped :) I'm afraid I really don't understand your follow-up question... could you elaborate?
    – cmhughes
    May 3, 2013 at 17:07
  • Yes, sorry. In each cell of the inner table you find a number (i.e. in that row 21, 6 and 3; in the next one 8, 14, 5, 2 etc). I need to insert three values per cell in every cell. This means that instead of the 21, I will need to put in there three values with the \pm, as you did in cell #1. I am trying, but it is not obvious... thanks again.
    – Pau
    May 3, 2013 at 19:07
0

Here is how you can construct that table with {NiceTabular} of nicematrix.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}
\begin{figure*}
    \centering
    \begin{NiceTabular}{|c|c|c c c c|}
        \Hline
        \Block{2-2}{$V_{\rm rot}/{\sigma}$}&&\Block{1-4}{W1}\\
        \Hline
        & &3&6&9&12\\
        \Hline
        \Block{6-1}{W2} & \Block{3-1}{3} & $0.090475\pm 0.011115$ & \Block{3-1}{21} & \Block{3-1}{6} & \Block{3-1}{3} \\
                        &                & $0.14861\pm 0.03562$   &                 &                &                \\
                        &                & $0.1861 \pm 0.01728$   &                 &                &                \\
                        & 6              & 8                      & 14              & 5              & 2              \\
                        & 9              & 8                      & 14              & 5              & 2              \\
                        & 12             & 8                      & 14              & 5              & 2              \\
        \Hline
    \end{NiceTabular}
    \caption{Multirow in multirow}   
    \label{ta.Multirow}                             
\end{figure*}
\end{document}

You need several compilations (because nicematrix uses PGF/Tikz nodes).

Output of the above code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .