# longtable body and head not the same width

I've got a problem : the width of the longtable body and head are not the same :

Here the code :

\begin{center}
\begin{longtable}{ | c | c | c | c | c | c |} \hline
Num de logt : & \makecell{type de \\ financement}  &  \makecell{surface utile \\ ponderree} & taux de loyer & loyer & total charges\\ \hline

Num de logt : & \makecell{type de \\ financement}  &  \makecell{surface utile \\ ponderree} & taux de loyer & loyer & total charges\\ \hline

\hline \multicolumn{6}{|r|}{{Continued on next page}} \\ \hline
\endfoot

\\
\endlastfoot

1054& HLM/O  & 74.00 & 4.69  &  347.361 &  64.811 \\ \hline
1054& HLM/O  & 74.00 & 4.69  &  347.361 &  64.811 \\ \hline
1054& HLM/O  & 74.00 & 4.69  &  347.361 &  64.811 \\ \hline
1054& HLM/O  & 74.00 & 4.69  &  347.361 &  64.811 \\ \hline
1054& HLM/O  & 74.00 & 4.69  &  347.361 &  64.811 \\ \hline
\end{longtable}


here an image of the result : https://drive.google.com/file/d/1h8xkPUXgC5fVSNgEAklf2C3pCLFIEK7d/view?usp=sharing

• Welcome to TeX SX! Guilty of what? I have no problem. Did you compile twice? Also: don't use the  center environment with longtables: they're automatically centred. Mar 29 '18 at 8:52
• it works on the many page table but when it's a one page table the width bug Mar 29 '18 at 8:58
• it works fine. you need to compile it twice. also your definition of \endlastfoot is wrong. correct is \hline \endlastfoot, not \\ \endlastfoot. Mar 29 '18 at 9:05
• you should get a message at the end of the document, telling you the widths have changed and to re-run latex. Mar 29 '18 at 11:05

with your code after second compilation i obtain:

spurious last row is consequence of your definition of lastfoot:

\\
\endlastfoot


if you remove \\ than you will obtain

remember: longtable had to be compiled twice!

\documentclass{article}
\usepackage{longtable, makecell}

\begin{document}
\begin{longtable}{ | c | c | c | c | c | c |} \hline
Num de logt : & \makecell{type de \\ financement}  &  \makecell{surface utile \\ ponderree} & taux de loyer & loyer & total charges\\ \hline
Num de logt : & \makecell{type de \\ financement}  &  \makecell{surface utile \\ ponderree} & taux de loyer & loyer & total charges\\ \hline
\hline
\multicolumn{6}{|r|}{{Continued on next page}} \\
\hline% i would omit it, it gives ugly result
\endfoot
\endlastfoot
%
1054& HLM/O  & 74.00 & 4.69  &  347.361 &  64.811 \\ \hline
1054& HLM/O  & 74.00 & 4.69  &  347.361 &  64.811 \\ \hline
1054& HLM/O  & 74.00 & 4.69  &  347.361 &  64.811 \\ \hline
1054& HLM/O  & 74.00 & 4.69  &  347.361 &  64.811 \\ \hline
1054& HLM/O  & 74.00 & 4.69  &  347.361 &  64.811 \\ \hline
\end{longtable}
\end{document}