A \tableofcontents is typeset by the document class, as in print. Each entry links to its heading. There are no pages, so the page numbers and the dotted leaders are left out. The build runs TEX as many times as the contents need to settle, up to three.
Contents
1 Entries
1.1 A longer title, which wraps under its number in a narrow column
2 Page numbers
1 Entries
Each entry of the contents is a link to its heading. The numbers keep the column the document class gives them.
1.1 A longer title, which wraps under its number in a narrow column
A title too long for the line continues under the title, not under the number, as in print.
2 Page numbers
There are no pages here, so the page numbers are left out.
\tableofcontents\section{Entries}Each entry of the contents is a link to its heading. The numbers keep the
column the document class gives them.
\subsection{A longer title, which wraps under its number in a narrow column}A title too long for the line continues under the title, not under the
number, as in print.
\section{Page numbers}There are no pages here, so the page numbers are left out.