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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can compile this table separately but when I want to compile the whole file, it gives me an error, which is fixed by removing \multirow.

\usepackage{multirow}

\begin{table}[htbp]
\begin{center}
\begin{tabular}{|c|c|c|c|p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}|}
\hline
A & B & C & D & \multicolumn{7}{|c|}{F}  \\ \hline
\multirow{ 2}{}{1} & 0 & 6 & 230 & 35 & 40 & 55 & 25 & 40 & 35 & \\
& 1 & 5 & 195 & 25 & 50 & 35 & 40 & 45 &  &  \\ \hline
\end{tabular}
\end{center}
\label{table2}
\end{table}
share|improve this question
up vote 27 down vote accepted

There are some errors in your code; you need to give a second argument to \multirow (an explicit value for the cell width or * to use the natural width of te contents); also, \label must always appear after \caption in floating environments:

\documentclass{article}
\usepackage{multirow}

\begin{document}

\begin{table}[htbp]
\centering
\begin{tabular}{|c|c|c|c|p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}p{1cm}|}
\hline
A & B & C & D & \multicolumn{7}{|c|}{F}  \\ \hline
\multirow{ 2}{*}{1} & 0 & 6 & 230 & 35 & 40 & 55 & 25 & 40 & 35 & \\
& 1 & 5 & 195 & 25 & 50 & 35 & 40 & 45 &  &  \\ \hline
\end{tabular}
\caption{A test caption}
\label{table2}
\end{table}

\end{document}

enter image description here

It is not clear why you are using p{...} columns if the cells are not containing paragraphs.

As a side note, I used \centering instead of the center environment to avoid adding extra vertical spacing (which in most cases is not desired).

You are not using all the columns you declared, but I guess that this was just for the example.

share|improve this answer
2  
Source for multirow – Jost Aug 8 '14 at 13:34
    
Note the need for using \cline{2-10} if you want a horizontal line between rows 2 and 3. – stvn66 Sep 28 '15 at 14:06

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.