I have been using the \longtable
environment and I have an issue with the captions.
All captions appear at the bottom of each part of the table, which is the result I wanted. However, there is a quite annoying wrinkle: only the caption at the bottom of the last part of the table is too close to the table border, and I cannot figure out how to control the spacing within \longtable
.
This is the code I have been using:
\begin{document}
\begin{center}
\scriptsize
\begin{longtable}{|p{2cm}|p{4cm}|p{8cm}|}\hline\hline
\multicolumn{1}{|p{2cm}|}{\textbf{Text1}} &
\multicolumn{1}{p{4cm}|}{\textbf{Text2}} &
\multicolumn{1}{p{8cm}|}{\textbf{Text3}}\\ \hline
\endfirsthead
\multicolumn{3}{p{3cm}}
{{\bfseries \tablename\ \thetable{} -- continued from previous page}}\\
\hline\multicolumn{1}{|p{2cm}|}{\textbf{Text1}} &
\multicolumn{1}{p{4cm}|}{\textbf{Text2}} &
\multicolumn{1}{p{8cm}|}{\textbf{Text3}}\\\hline
\endhead
\hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
\caption[Caption]{Caption}\label{label-caption}
\endfoot
\caption[Caption]{Caption}\label{label-caption}
\endlastfoot
\end{longtable}
\end{center}
\end{document}
Any advice is more than welcome! Thanks. I.