Is there a way of inserting a predefined text and/or command into every cell of a column?
In my case, I wish to create a table where every row is numbered in the first column, but I wish to do so without actually writing anything in the first cell of every row. With a command like the one in question, I could solve my problem using the following code only with a few adjustments:
Code: Select all
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{xtab}
\usepackage[table]{xcolor}
% insert package
\begin{document}
\newcounter{counter}
\setcounter{counter}{1}
% insert command
\begin{center}
\begin{xtabular}{ % insert command
r<{\addtocounter{counter}{1}} l l }
& item1 & item2 \\
& item3 & item4 \\
% and so on
\end{xtabular}
\end{center}
\end{document}
Thanks