Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

2 Answers 2

up vote 5 down vote accepted

\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

share|improve this answer
    
thx, helped me. saved my day. I am surprised how quick the answer was :) –  LeO May 1 at 20:10

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}
share|improve this answer
    
thx, helped me. I am surprised how quick the answer was :) (+ I can only accept one answer - sorry :) ) –  LeO May 1 at 20:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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