Is there a way to add a table with a table-number shown below it, but without any caption?
I also need to add a label for referencing the table.
When I use \caption{}
:
\documentclass{book}
\begin{document}
\begin{table}[h]
\centering
\begin{tabular}{|c|c|}
\hline
1
&
2
\\\hline
\end{tabular}
\caption{}\label{lab}
\end{table}
\end{document}
The tabled is numbered but it has :
after the number as if there is some caption after it.
Best Answer
Adding
\caption{}
to a table adds an unwanted table separator to the caption. For example, you might end up with a caption:You can control this, for example, with the package
caption
. For example:The caption now reads:
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: