Possible Duplicate:
bottomrule not working in a self-made environment
I have this environment for consistent tables in my latex documents:
\newenvironment{defaultTable}[2] {
\@float{table}[h]
\noindent
\tabularx{\textwidth}{#1}
\specialrule{0.5pt}{10pt}{0pt}
\rowcolor[gray]{.9}
\gdef\mycaption{#2}
} {
\bottomrule
\endtabularx
\emph{\caption{\mycaption}}
\end@float
}
Unfortunately, the line with \bottomrule leads to this error, which i don't understand:
! Misplaced \noalign. \bottomrule ->\noalign {\ifnum 0=`}\fi \@aboverulesep =\aboverulesep \global... l.27 \end{defaultTable}
When I use it inside the environment it works though
\begin{defaultTable}{X X}{Blablah Table}
(..)
\bottomrule
\end{defaultTable}
What am I doing wrong?
{defaultTable}defined not to have\bottomrule, but otherwise be the same. – Charles Stewart Dec 07 '10 at 14:04