You can replicate the &
using details from Repeat command n times?:

\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\cs_new_eq:NN \Repeat \prg_replicate:nn
\ExplSyntaxOff
\begin{document}
\begin{tabular}{ @{} l l *{15}{|r} | @{} }
A & B \Repeat{15}{& c} \\
\Repeat{13}{&} & 1 & 2 & 3
\end{tabular}
\end{document}
A similar \Repeat
macro is possible using multido
:
\usepackage{multido}
\makeatletter
\renewcommand{\Repeat}[2]{%
\def\@@x{}% Make sure \@@x is defined
\multido{\i=1+1}{#1}{\protected@xdef\@@x{\@@x #2}}% Create global repetition
\@@x% Execute repetition
}
\makeatother
Using \newcommand{\Repeat}[2]{\multido{\i=1+1}{#1}{#2}}
won't work here because each cell within the tabular
creates a group and the default definition of \multido
doesn't make a global assignment of the stepping macro (\i
). Instead, one has to assemble the repetition into a macro before executing it.
Also note the condensed way in which the column specification can be specified: *{<num>}{<col spec>}
repeats <col spec>
a total of <num>
times.