How to Refer to a Table in LaTeX (\ref, \autoref, \cref)

Updated Tested on TeX Live 2025 (pdfLaTeX), Oct 2026 4 min read

Quick answer

To refer to a table in LaTeX, put \label{tab:results} right after \caption{...} inside the table environment, then write Table~\ref{tab:results} in your text. LaTeX inserts the number and keeps it up to date. With hyperref, \autoref{tab:results} adds the word Table for you; with cleveref, use \cref. Compile twice.

A table reference is just a label plus a reference command. LaTeX does the numbering, so references stay correct when you add, remove or reorder tables.

What you’ll learn:

Label a table with \label and \caption

Use this on every table you’ll mention in the text. The table environment numbers the table through \caption, and \label names that number.

  1. Wrap the tabular in a table environment.
  2. Add \caption{…}.
  3. Put \label{tab:name} directly after the caption.
\begin{table}[htbp]
\centering
\caption{Test results by group}
\label{tab:results}
\begin{tabular}{|c|c|}
\hline
Group & Mean \\
\hline
A & 4.2 \\
B & 3.9 \\
\hline
\end{tabular}
\end{table}

Result: a numbered, captioned table that LaTeX knows as tab:results.

Two-column LaTeX table with a header row and a numbered caption

The tab: prefix is only a naming habit, but it keeps table, figure (fig:) and equation (eq:) labels apart. Captions above tables are the usual style; for a caption below, put \caption and \label after the tabular.

If the cells hold long text, see how to wrap long text in table cells with p{} or tabularx columns.

Refer to a table with \ref

Use this when you want plain numbers and full control of the wording. \ref prints only the number, so type “Table” yourself:

As shown in Table~\ref{tab:results}, group A scored higher.

The ~ is a non-breaking space; it stops “Table” and its number from landing on different lines.

Sentence in a compiled LaTeX document that refers to Table 1 using \ref

Result: “As shown in Table 1, …”, and the number updates whenever the table order changes. Compile twice to see it.

LaTeX source with \caption and \label{tab:results} on a table and \ref{tab:results} in the text, and the compiled PDF reading As shown in Table 1 above Table 1

Add the word Table automatically with \autoref

Use this when you load hyperref anyway and want “Table 1” without typing “Table”. \autoref belongs to the hyperref package, so it fails with “Undefined control sequence” unless hyperref is loaded.

\usepackage{hyperref} % in the preamble, after most other packages
As detailed in \autoref{tab:results}, the results show a clear trend.

Compiled sentence where \autoref produces the clickable text Table 1

Result: “As detailed in Table 1, …”, with “Table 1” as a clickable link. The same command prints “Figure”, “Section” or “Equation” for other label types.

Refer to several tables with cleveref

Use this in longer documents. The cleveref package’s \cref works like \autoref but also handles several labels at once and is easier to customise.

  1. Load cleveref after hyperref:

    \usepackage{hyperref}
    \usepackage{cleveref}
  2. Use \cref mid-sentence and \Cref at the start of one:

    \Cref{tab:results} summarises the scores.
    See \cref{tab:results,tab:second} for details.

Result: “Table 1 summarises the scores. See tables 1 and 2 for details.” cleveref groups and sorts multiple references for you.

Reference figures, equations and listings the same way

Use this for any numbered item. The pattern is always: give it a number, add \label right after the numbering command, then reference it.

ItemWhere \label goesReference
TableAfter \caption in tableTable~\ref{tab:x}
FigureAfter \caption in figureFigure~\ref{fig:x}
EquationInside equationEquation~\eqref{eq:x} (amsmath)
SectionAfter \section{…}Section~\ref{sec:x}
Code listinglabel= option of lstlistingListing~\ref{lst:x}

For figures, see how to label and reference figures. Code blocks are covered in the guide to inserting code listings in LaTeX.

Which reference command should you use?

CommandPackageOutputHandles lists of labels
\refBuilt in1No
\pagerefBuilt inPage number, e.g. 4No
\autorefhyperrefTable 1No
\cref / \Crefclevereftable 1 / Table 1Yes (tables 1 and 2)
\vrefvariorefTable 1 on the next pageWith cleveref
\namerefhyperrefThe caption or heading textNo

Overleaf’s cross-referencing guide and the cleveref package on CTAN go deeper into the options.

Common errors

  • ?? instead of a number: compile twice. If it persists, check that the label names match exactly, including case.
  • “Reference ‘tab:results’ on page 1 undefined” warning: same cause as ??.
  • The reference shows the section number: \label is before \caption, or outside the table. Move it directly after \caption.
  • “Undefined control sequence” at \autoref: load hyperref.
  • “Undefined control sequence” at \cref: load cleveref, after hyperref.
  • “There were multiply-defined labels” warning: two items share a label. Rename one.
  • The label is inside tabular: it still works if the caption is above it, but put it next to \caption for clarity.

Making references clickable

Loading hyperref turns every reference into a link. To change link colours or remove the red boxes, use \hypersetup, as explained in the guide to hyperref link colours and URLs. The hyperref package on CTAN lists every option.

If you later need to convert the finished document to Word, check the cross-references in the result; they may come through as plain text. More reference and table tutorials are in the LaTeX guides.

Word’s own numbered captions and cross-references are covered in how to insert captions in Word.

Frequently asked questions

Why does my LaTeX table reference show ??

LaTeX writes labels to the .aux file on the first run and reads them on the next, so compile twice. If ?? remains, the label name in \ref does not match the one in \label exactly.

Why does \ref give the section number instead of the table number?

The \label is placed before \caption, or outside the table environment. Move \label to directly after \caption so it picks up the table counter.

What is the difference between \autoref and \cref?

Both add the word Table automatically. \autoref comes with hyperref; \cref from cleveref also handles lists and ranges, such as \cref{tab:a,tab:b} giving "tables 1 and 2", and is easier to customise.

How do I reference the page a table is on?

Use \pageref{tab:results} for the page number, or \vref{tab:results} from the varioref package, which adds phrases like "on the next page" automatically.

How do I make table references clickable?

Load the hyperref package. Every \ref, \autoref and \cref then becomes a link that jumps to the table in the PDF.