The following 'naïve' solution throws the error:
ERROR: Misplaced \omit.--- TeX said --- \multispan ->\omit @multispan l.13 } \ --- HELP --- From the .log file...
I expect to see \omit only after tab marks or the \cr of an alignment. Proceed, and I'll ignore this case.
\documentclass{article}
\usepackage{expl3}
\ExplSyntaxOn
\begin{document}
\seq_set_split:Nnn \l_tmpa_seq { , } { 1 , 2 , 3 }
\begin{tabular}{*{\seq_count:N \l_tmpa_seq}{c}}
hellow & world \\
\seq_map_inline:Nn \l_tmpa_seq {
\multicolumn{1}{|c|}{#1} &
} \\
goodbye & world
\end{tabular}
\end{document}
where I'd like to come up with a table like:
hello world
| 1 | 2 | 3 |
goodbye world
What's the most efficient / clearest way to go about this?

&to the first and last row? – hugovdberg Apr 03 '14 at 18:34:)as long as you don't make more columns than you specify, you're ok. The question is more to get the result I'm going for, not necessarily to fix the code I have. I'm fairly certain my approach will turn out to be utterly fruitless:(– Sean Allred Apr 03 '14 at 18:35\seq_map_inlineand an extra&after the third item? You have 3 items, each with a&so specifying 4 cells in that row actually, while a count of the sequence returns 3. Perhaps a conditionalif items < count insert &? – hugovdberg Apr 03 '14 at 18:37:)see my edit – Sean Allred Apr 03 '14 at 18:39\seq_map_inline:Nnis not expandable. You can use\seq_map_function:NNafter defining a (non-protected) function which does\multicolumn{...}{...}{#1}. – Bruno Le Floch Apr 03 '14 at 21:02