Caption on tabular environment

If you don't want to use a table environment, then you could use

\captionof{table}{Your caption here} 

from the caption package.

\documentclass{article}
\usepackage{caption}
\newcommand{\mc}[3]{\multicolumn{#1}{#2}{#3}}

\begin{document}
\begin{center}
\captionof{table}{Your caption here}
\begin{tabular}{rccll}
   &   & \mc{3}{c}{Colin}\\
   &   & a & \mc{1}{c}{b} & \mc{1}{c}{c}\\\cline{3-5}
Rose & \mc{1}{c|}{A} & \mc{1}{c|}{(1,2)} & \mc{1}{c|}{(2,5)} & \mc{1}   {c|}{(4,4)}\\\cline{3-5}
   & \mc{1}{c|}{B} & \mc{1}{c|}{(7,4)} & \mc{1}{c|}{(3,5)} & \mc{1}{c|}{(0,6)}  \\\cline{3-5}
\end{tabular}
\end{center}

 \end{document}

Of course, using this approach means that your tables do not float- depending on the size of your document, and how many tables & figures it contains, this could be a serious issue.


In LaTeX, a caption is usually associated with a float (like table, figure, ...). And floats are meant to move within the document based on float-specifiers submitted by the user. For example,

\begin{table}[htbp]
  ...
\end{table}

Here the use of htbp provides LaTeX with a preference of where to place the float. First try "here", then try at the "top" of the page, then try at the "bottom" of the page, then try on a "page" of it's own (a so-called "page of floats"). More on this is explained in How to influence the position of float environments like figure and table in LaTeX?

Inserting a \caption{<your caption>} command within this environment implies that it will move with the float, always making sure that they stay together - this is important:

\begin{table}[ht]% Try here, and then top
  ...
  \caption{<your caption>}
\end{table}

You'll notice that the placement of the \caption{<your caption>} command is at the bottom of the table environment, meaning it will appear in that sequence in your output. If you want a caption at the top of the environment, put \caption{<your caption>} above the rest of the contents. The caption package provides some means to automate this placement.

If you're interested in referencing the caption (since it comes with an appropriate number, like Table 2.1), you need to put a \label{<your label>} after \caption{<your caption>} and refer to the table as Table~\ref{<your label>} in your text (compiling your document at least twice on this first go for this to work, of course).

However, if all of this is too much, and you don't care about referencing the table, or even something like a "List of Tables" (a table of contents for your tables), or even a table number, you could just do the following:

\noindent% Insures there's no paragraph indent
\begin{minipage}{\textwidth}% Minipage has width exactly the same as the text block
  \centering% Centers the contents of the minipage
  \begin{tabular}{<col spec>}
    %<tabular contents>
  \end{tabular}

  \medskip% Gives a medium skip between the tabular & caption (also try \smallskip or \bigskip)

  This is an interesting table.% Your caption goes here.
\end{minipage}

This places all the content (tabular and your caption) in a minipage environment of width \textwidth. The minipage will ensure that the contents remains in a fixed block (so that your caption doesn't end up on a page that your tabular is not).


I think the easiest way is just to wrap the {tabular} block inside a {table} block. The following example has a {tabular} truth table and {tabular} accuracy metrics wrapped inside a table which gives it both a caption and a label:

\begin{table}[h]
    \begin{tabular} {|c|c||>{\centering}p{.9cm}|>{\centering}p{.9cm}|>{\centering}p{.9cm}|c|}
        \hline
        $Truth$ & $Predicted$ & ADA & SVM & GLM & Blended \\ \hline
        T & T & 512 & 463 & 423 & 472 \\ 
        T & F & 19  & 68  & 108 & 0   \\ 
        F & T & 5   & 85  & 67  & 22  \\ 
        F & F & 580 & 500 & 518 & 98  \\ \hline
    \end{tabular} \\ \vskip .5cm

    \begin{tabular} {|>{\centering}p{2.9cm}||c|c|c|c|c|}
        \hline
        $Accuracy Metric$ & ADA & SVM & GLM & Blended \\ \hline
        Precision & 99.0\% & 84.5\% & 86.3\% & 95.5\% \\ 
        Recall    & 96.4\% & 87.2\% & 79.7\% & 100\%  \\
        Accuracy  & 97.8\% & 86.3\% & 84.3\% & 96.3\% \\ \hline
    \end{tabular} 

    \caption{Truth Tables and Accuracy Measures for each modeling library.}
    \label{tab:truthTables}   
\end{table}

Jake Drew www.jakemdrew.com