3

Could somebody give me a hint, why the \multirow doesn't work as it should?

\documentclass{article}
\usepackage{multirow}
\begin{document}

\begin{tabular}{c|c|c|c|c|c|}
\emph{step} & 0 & 1 & 2 & 3 & 4 \\ \hline
1. step  &  &  &  &3  &   \\ \hline \hline
\multirow{2}{*}{2nd step}  & 6 &  & 2 &3  &   \\ \hline
            &  &  &  &8  &   \\ \hline \hline

\end{tabular}

\end{document}
4

\hline is not aware of the multirow, use \cline instead:

\documentclass{article}
\usepackage{multirow}
\begin{document}

\begin{tabular}{c|c|c|c|c|c|}
\emph{step} & 0 & 1 & 2 & 3 & 4 \\ \hline
1. step  &  &  &  &3  &   \\ \hline \hline
\multirow{2}{*}{2nd step}  & 6 &  & 2 &3  &   \\ \cline{2-6}
            &  &  &  &8  &   \\ \hline \hline

\end{tabular}

\end{document}

enter image description here

  • thx, helped me. saved my day. I am surprised how quick the answer was :) – LeO May 1 '14 at 20:10
4

You need to remove the horizontal line between the two cells, using \cline{2-6} instead of \hline.

\documentclass{article}
\usepackage{multirow}
\begin{document}

\begin{tabular}{c|c|c|c|c|c|}
\emph{step} & 0 & 1 & 2 & 3 & 4 \\ \hline
1. step  &  &  &  &3  &   \\ \hline \hline
\multirow{2}{*}{2nd step}  & 6 &  & 2 &3  &   \\ \cline{2-6}
            &  &  &  &8  &   \\ \hline \hline

\end{tabular}

\end{document}

However, I would recommend to get rid of both the vertical lines and the multirow package:

enter image description here

\documentclass{article}
\usepackage{booktabs}
\begin{document}

\begin{tabular}{lcccccc} \toprule
 & 0 & 1 & 2 & 3 & 4 \\ \midrule[\heavyrulewidth]
\bfseries 1st step
 &   &   &   & 3 &   \\ \midrule
\bfseries 2nd step
 & 6 &   & 2 & 3 &   \\ \cmidrule{2-6}
 &   &   &   & 8 &   \\ \bottomrule
\end{tabular}

\end{document}
  • thx, helped me. I am surprised how quick the answer was :) (+ I can only accept one answer - sorry :) ) – LeO May 1 '14 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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