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

Bernard
  • 271,350
  • 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 '21 at 18:54
  • It was compiled 3 times, can I use \resizebox with longtable to make horizontaly fit in the paper ? – user2535338 Jul 12 '21 at 19:02
  • No. You should use for example xltabular˛ environemnt (combination of tabularx and longtable, or new longtblr defined in the tabularray package. But this is not addressed in your question. – Zarko Jul 12 '21 at 19:06
  • 1
    An example of use of the xltabular you can see in https://tex.stackexchange.com/questions/593830/table-with-many-columns-xltabular/593834#593834 – Zarko Jul 12 '21 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 – David Carlisle Jul 12 '21 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. – David Carlisle Jul 12 '21 at 22:11
  • I've explained better in a new question https://tex.stackexchange.com/questions/604768/how-to-resize-the-longtable-in-latex – user2535338 Jul 12 '21 at 22:42
  • the new question is completely different question: that's about how to linebreak long strings of non-words. Do you still have a question about longtable chunks getting the same width? if so please edit the question to make an answer, if not, please delete this question. – David Carlisle Jul 13 '21 at 06:54

0 Answers0