As many rows as you want:
\documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\mycommand}{m} { \begin{tabular}{c} \seq_set_from_clist:Nn \l_tmpa_seq { #1 } \seq_use:Nn \l_tmpa_seq { \\ } \end{tabular} } \ExplSyntaxOff \begin{document} \mycommand{a} \mycommand{a,b} \mycommand{a,b,c,d,e,f} \end{document}

Alternative approach:
\documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\mycommand}{m} { \begin{tabular}{c} \clist_map_function:nN { #1 } \joan_makerow:n \end{tabular} } \cs_new_protected:Nn \joan_makerow:n { #1 \\ } \ExplSyntaxOff \begin{document} \mycommand{a} \mycommand{a,b} \mycommand{a,b,c,d,e,f} \end{document}
Look, ma! No packages!
\documentclass{article} \makeatletter \newtoks\joan@rows \newcommand{\mycommand}[1]{% \begin{tabular}{c} \@for\next:=#1\do{\joan@rows=\expandafter{\the\expandafter\joan@rows\next\\}}% \the\joan@rows \end{tabular}% } \makeatother \begin{document} \mycommand{a} \mycommand{a,b} \mycommand{a,b,c,d,e,f} \end{document}
Addition
Suppose you want to uppercase the items. Then the “no packages” approach is
\documentclass{article} \makeatletter \newtoks\joan@rows \newcommand{\mycommand}[1]{% \begin{tabular}{c} \@for\next:=#1\do{\joan@rows=\expandafter{\the\expandafter\joan@rows\expandafter\MakeUppercase\expandafter{\next}\\}}% \the\joan@rows \end{tabular}% } \makeatother \begin{document} \mycommand{a} \mycommand{a,b} \mycommand{a,b,c,d,e,f} \end{document}
The xparse approach is much easier:
\documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\mycommand}{m} { \begin{tabular}{c} \clist_map_function:nN { #1 } \joan_makerow:n \end{tabular} } \cs_new_protected:Nn \joan_makerow:n { \tl_upper_case:n { #1 } \\ } \ExplSyntaxOff \begin{document} \mycommand{a} \mycommand{a,b} \mycommand{a,b,c,d,e,f} \end{document}
