\begin{longtable}[]{@{}lr@{}}
\hline
A & B\tabularnewline
\hline
\endfirsthead
1 & 2\tabularnewline
\hline
\end{longtable}
\begin{longtable}[]{@{}lll@{}}
\hline
X & Y & Z\tabularnewline
\hline
\endfirsthead
a & b & c\tabularnewline
\hline
\end{longtable}
