A tabular
alone is just a box in LaTeX and can be used anywhere; it does not represent what is considered a table
, which is the first thing you "need" in order to place something in the List of Tables (LoT) . Well, technically you don't need a table
, but I'll get to that in a moment. In your example you might use
\listoftables
...
\begin{table}[ht]
\begin{tabular}{..}
...
\end{tabular}
\caption[This is a table]{This is a table that holds valuable information.}
\end{table}
...
It's part of the \caption
's content that makes its way into the LoT. More specifically, it's the (optional) first argument, or if that's not specified, the (mandatory) second argument that is printed in the LoT.
Note that we've wrapped the tabular
inside a table
. The latter is called a float, which can more around in the document. If you want to manage the placement of this float (perhaps because you don't like the way LaTeX decides this), read up on How to influence the position of float environments like figure
and table
in LaTeX?
One way of forcing the placement is to avoid a table
(float) completely, and use the caption
package's \captionof{table}
functionality. This tricks LaTeX into thinking that it's inside a table
(float), and allows you to set a "regular \caption
". The tiny capt-of
package provides similar functionality*. To be clear, you could use
...
\begin{tabular}{..}
...
\end{tabular}\par\nobreak
\captionof{table}[This is a table]{This is a table that holds valuable information.}
...
The use of \par\nobreak
attempts to keep the tabular
and it's associated \caption
together on the same page.
Of course, the above discussion holds just as well for figure
s. That is, you can have (say) \includegraphics[..]{...}
anywhere in the document, but you need to use an appropriate \caption
for that figure
(or \captionof
) for it to make it into the List of Figures (LoF).
* Both caption
and capt-of
suffer from the fact that it fools LaTeX permanently: It updates \@captype
but never resets it. As such, it's perhaps better to provide some scope within which you use \captionof
, like \begingroup
...\endgroup
.