\DocumentMetadata{
uncompress,
pdfversion=1.7,
lang=en-US,
testphase=phase-III
}
\documentclass{article}
\usepackage{etoc}
\usepackage{hyperref}
\usepackage{array}
\begin{document}
\begingroup
\etocglobaldefs % necessary for \etocname etc... to survive to & closing groups
\etocsetlinestyle{section}
{}
{\\\etocnumber&\etocname &\etocpage }
{}
{}
\etocsettocstyle{\begin{tabular}{ccc}number&name&page}{\end{tabular}}
\tableofcontents
\endgroup
\section{One}
\section{Two}
\section{Three}
\section{Four}
\end{document}