I had a very dirty answer, but I found theneater solution below while reading the documentation of the array
package. In particular, this is inspired from how the *
column specifier is defined there.
The idea is to introduce the new column type \expand
(\newcolumntype
sets up most of the necessary ingredients), and then redefine \NC@rewrite@\expand
to expand the next token with \expandafter
, and then continue the action that array
is doing at that time (namely finding user-defined column types and replacing them by their definition).
\documentclass{article}
\usepackage{array}
\makeatletter
\newcolumntype{\expand}{}
\long\@namedef{NC@rewrite@\string\expand}{\expandafter\NC@find}
\makeatother
\begin{document}
\def\mypream{c|*{2}{c|||}}
\begin{tabular}{c\expand\mypream cc}
a & b & d &e & f & apsdoi \\
cde & def & erasd &arp & sefoi & wp
\end{tabular}
\end{document}