which indicated in Table ~\ref{tb:3_1}.

I have a following code:

Portrait                                                                      & Einstein, Lena, woman dark hair                                                                     \\ \hline
\begin{tabular}[c]{@{}l@{}}Human,\\ animal/plants\end{tabular}                & \begin{tabular}[c]{@{}l@{}}Barbara,\\ Cameraman, living room, Mandril, peppers, pirate\end{tabular} \\ \hline
\begin{tabular}[c]{@{}l@{}}Outdoor/\\ Architecture and structure\end{tabular} & \begin{tabular}[c]{@{}l@{}}Boat,\\ lake gray, walk bridge, house\end{tabular}                       \\ \hline
Aviation                                                                      & Chemical plant, jet plane                                                                           \\ \hline
Medical                                                                       & Mri                                                                                                 \\ \hline
\caption{Grouped Images}

Table looks great, problem is in the pdf part.

which indicated in Table ??. How can fix the question mark problem?

  • 5
    label has to be after (or in) caption not before Jun 13, 2017 at 22:21
  • 1
    Welcome! Please post complete minimal code people can compile. (Not really necessary at this point for this question, though.)
    – cfr
    Jun 13, 2017 at 22:38
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. A suggestion: Do us a favour and change your username to something more telling than "user1234". Jun 13, 2017 at 22:43

1 Answer 1


To take care of the main problem: As David Carlisle has already pointed out in a comment, the \label statement must come after (ideally: immediately after) the \caption statement.

In addition, you may want to simplify and streamline your LaTeX code by setting up a macro to contain the split-line tabular material.

% custom macro to house the split-line tabular material:
\newcommand\mytab[1]{\begin{tabular}[c]{@{}l@{}} #1 \end{tabular}}
Portrait & Einstein, Lena, woman dark hair  \\ \hline
\mytab{Human,\\ animal/plants}
         & \mytab{Barbara,\\ Cameraman, living room, Mandril, peppers, pirate} \\ \hline
\mytab{Outdoor/\\ Architecture and structure} 
         & \mytab{Boat,\\ lake gray, walk bridge, house} \\ \hline
Aviation & Chemical plant, jet plane \\ \hline
Medical  & MRI \\ \hline
\caption{Grouped Images} \label{tb:3_1}

A cross-reference to Table \ref{tb:3_1}.

You must log in to answer this question.

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