General ⇒ Automatic numbering of cells in a table
Automatic numbering of cells in a table
How can I generate an automatic numbering of the first column cells in a table?
Writing them 'by hand' is a non sense. I've done it but I swear not to do it ever again!
Thanks.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Automatic numbering of cells in a table
here is one possibility, using a custom counter:
Code: Select all
\documentclass{article}
\usepackage{array}
\newcounter{TableRow}
\newcolumntype{n}{>{\stepcounter{TableRow}\arabic{TableRow}}c}
\begin{document}
\setcounter{TableRow}{0}
\begin{tabular}{nl}
& Text \\
& Text \\
& Text
\end{tabular}
\end{document}