How to suppress caption numbering in a table?

How can the auto-numbering on table captions be suppressed? For example, I have a table:

\section{Data}
\begin{table}[h]
\setlength{\arrayrulewidth}{1.5px}
\centering
\begin{tabular}{lcccc} \bottomrule
\bottomrule
\end{tabular}
\caption{This is my caption.}
\end{table}


I just want the caption to read This is my caption. However, when I compile this code into a PDF file my table is automatically named Table 1. This is my caption. I've tried using \caption*, to suppress the auto-generated Table 1., but this does not solve my problem. Can anyone help?

-
\caption* should do the job (if the caption package has been loaded). Can you please post a (complete) minimal working example showing the problem? –  Gonzalo Medina Sep 14 '11 at 2:20
@dr.bunsen: What exactly do you mean by "this does not solve my problem"? What happens? Furthermore your code snipped does not even contain \caption* so how should it show us the problem? –  Axel Sommerfeldt Sep 14 '11 at 6:46
Thanks, for the help - this solved my problem. My problem was that I was not importing the caption package. I didn't realize that I needed to import this package since my table was displaying a caption without importing this package. –  dr.bunsen Sep 14 '11 at 10:07

You can suppress the caption label in saveral ways using features provided by the caption package:

1. Using \caption* instead of \caption:

\documentclass{article}
\usepackage{caption}

\begin{document}

\begin{table}[h]
\centering
\begin{tabular}{c}
text1\\
text2
\end{tabular}
\caption*{This is my caption.}
\end{table}

\end{document}

2. Using the option labelformat=empty for \captionsetup.

\documentclass{article}
\usepackage{caption}

\captionsetup[table]{labelformat=empty}

\begin{document}

\begin{table}[h]
\centering
\begin{tabular}{c}
text1\\
text2
\end{tabular}
\caption{This is my caption.}
\end{table}

\end{document}


Since I used table as optional argument for \captionsetup, this change will only affect the table environments; of course, you can use figure instead (to affect only the figure environment), or no optional argument at all, which means that the change will affect all your floating objects.

Also, as I used \captionsetup in the preamble, the change will affect all the (in this case) table environments in your document; if you want the change to affect only a particular table environment, you can use

\captionsetup{labelformat=empty}


inside that particular table environment.

The result after compilation of any of my example codes is

-

Use the caption package to control the look and feel of the captions:

\documentclass{article}
\usepackage{caption}
\begin{document}
\section{Data}
\begin{table}[h]
\centering
\begin{tabular}{lcccc}
...table content...
\end{tabular}
\caption*{This is my caption.}
\end{table}
\end{document}

-