Adding \caption{}
to a table adds an unwanted table separator to the caption. For example, you might end up with a caption:
Table 1:
You can control this, for example, with the package caption
. For example:
\documentclass{article}
\usepackage{booktabs}
\usepackage[labelsep=none]{caption}
\begin{document}
\begin{table}
\centering
\begin{tabular}{cc}
\toprule
left number & right number \\
\midrule
5.6 & 3.8 \\
1.3 & 20.4 \\
10.4 & 5.2 \\
1.3 & 0.8 \\
7.2 & 3.9 \\
2.5 & 16.2 \\
\bottomrule
\end{tabular}
\caption{}
\label{tab:tab}
\end{table}
Let's refer to Table~\ref{tab:tab}.
\end{document}
The caption now reads:
Table 1
If there are other tables that need an ordinary caption, you can use \captionsetup
to temporarily change options. See the documentation for more details.
The package also contains further options to control the caption. For example, if you really want only the number (without "Table" in front) under the table, you can use:
\documentclass{article}
\usepackage{booktabs}
\usepackage[labelsep=none,labelformat=empty]{caption}
\begin{document}
\begin{table}
\centering
\begin{tabular}{cc}
\toprule
left number & right number \\
\midrule
5.6 & 3.8 \\
1.3 & 20.4 \\
10.4 & 5.2 \\
1.3 & 0.8 \\
7.2 & 3.9 \\
2.5 & 16.2 \\
\bottomrule
\end{tabular}
\caption{\ref{tab:tab}}
\label{tab:tab}
\end{table}
Let's refer to table~\ref{tab:tab}.
\end{document}
\caption{}
?\ref
? No you say you do want the number printed.\caption{}
will produce something likeTable 3