I'm defining new environment and I'm trying to pass to it two arguments:
\newenvironment{ctable}[2]%
{%
\begin{center}%
\begin{tabular}{#1}%
}%
{%
\end{tabular}%
\captionof{table}{#2}%
\end{center}%
}
Problem is with a second parameter (captionof
), it isn't working. Is there a nice way to make it work? I'm aware that captionof
could/should be after \begin{center}
or before it, but I need it to be below the table. In short: first argument defines table, second defines caption of the table.
Thank you.