How to suppress caption numbering in a table?

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

enter image description here


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}

The memoir class (caters for the book, report, and article classes) incudes the \legend macro

\legend{text}

which can be used to put an anonymous caption, or legend, into a float environment but it can be used anywhere, such as in a marginal note.

See section Continuation captions and legends in the manual (> texdoc memoir)