I have a custom table-environment defined with \newenvironment. I have a caption in this environment, but I want to have it at the end.
My environment looks (a little simplified) like this:
\newenvironment{mytable}[2]{\begin{table}[hbtp]\caption{#1}\label{#1}\begin{center}\begin{tabular}{#2}}{\end{tabular}\end{center}\end{table}}
I wanna put the caption at the end, like this:
\newenvironment{mytable}[2]{\begin{table}[hbtp]\label{#1}\begin{center}\begin{tabular}{#2}}{\caption{#1}\end{tabular}\end{center}\end{table}}
But that doesn't work, because I cannot use the parameters in the end of the environment. How can I solve this problem?