0

I'm trying to put a very long table in a latex document, it works the table is in more than a page but its header is not following the content size. enter image description here

The code is the following:

\begin{longtable}[c]{|l|l|l|l|l|}
 \caption{Long table caption.\label{long}}\\

 \hline
 \multicolumn{5}{| c |}{Begin of Table}\\
 \hline
\textbf{Chave} & \textbf{X}   & \textbf{X} & \textbf{X} & \textbf{X}\\
 \hline
 \endfirsthead

 \hline
 \multicolumn{5}{|c|}{Continuation of Table \ref{long}}\\
 \hline
 \textbf{Chave} & \textbf{X}   & \textbf{X} & \textbf{X} & \textbf{X}\\
 \hline
 \endhead

 \hline
 \endfoot

 \hline
 \multicolumn{5}{|c|}{End of Table}\\
 \hline\hline
 \endlastfoot
 X & X & X & X & X \\ \hline
 X & X & X & X & X \\ \hline
 X & X & X & X & X \\ \hline
 X & X & X & X & X \\ \hline
....
....
 \end{longtable}

Could someone help-me? Thank you all folks

8
  • How many time you compile your document? Your code fragment gives expected correct result, however, it is not related to showed image at all.
    – Zarko
    Jul 12, 2021 at 18:54
  • It was compiled 3 times, can I use \resizebox with longtable to make horizontaly fit in the paper ? Jul 12, 2021 at 19:02
  • 1
    An example of use of the xltabular you can see in tex.stackexchange.com/questions/593830/…
    – Zarko
    Jul 12, 2021 at 19:12
  • 2
    Please fix your example so that it is a complete small document that produces the problem shown, it is much harder to debug a fragment Jul 12, 2021 at 20:51
  • 2
    @user2535338 never use \resizebox with tables, it can't work at all with longtable and with tabular it does not give errors but can not produce good results. Jul 12, 2021 at 22:11

0

You must log in to answer this question.

Browse other questions tagged .