# How can I remove the last "Continued from previous page" from my longtable?

Right now I have a long table spanning across both pages. At the bottom of the portion of the first page it says "Continued on next page", which is good, but this also appears at the bottom of the portion on the second page. Here's the code I'm using:

\begin{longtable}{cc}
\caption{Reward surfaces of all MuJuCo environments} \\
\hline
\multicolumn{2}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\hline \multicolumn{2}{r}{\textit{Continued on next page}} \\
\endfoot
\hline

\includegraphics[width=2.75in,keepaspectratio]{./plots/mujuco/antepisode_rewards_3dsurface.png} & \includegraphics[width=2.75in,keepaspectratio]{./plots/mujuco/halfcheetahepisode_rewards_3dsurface.png} \\
\includegraphics[width=2.75in,keepaspectratio]{./plots/mujuco/hopperepisode_rewards_3dsurface.png} & \includegraphics[width=2.75in,keepaspectratio]{./plots/mujuco/humanoid@3x3episode_rewards_3dsurface.png} \\
[...]

\end{longtable}

• you need an \endlastfoot without that Sep 10, 2021 at 16:36

Please see the following MWE resulting in two pages. Please see that I marked important code changings with <=====.

\documentclass{article}

\usepackage{longtable}
\usepackage{graphicx}

\begin{document}
\begin{longtable}{cc}
\caption{Reward surfaces of all MuJuCo environments} \\
\hline
\multicolumn{2}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\hline
\multicolumn{2}{r}{\textit{Continued on next page}} \\
\endfoot
\hline % <============================================================
\endlastfoot % <========================================================
\includegraphics[width=2.75in,keepaspectratio]{example-image} & \includegraphics[width=2.75in,keepaspectratio]{example-image-a} \\
\includegraphics[width=2.75in,keepaspectratio]{example-image} & \includegraphics[width=2.75in,keepaspectratio]{example-image-b} \\
\includegraphics[width=2.75in,keepaspectratio]{example-image} & \includegraphics[width=2.75in,keepaspectratio]{example-image-a} \\
\includegraphics[width=2.75in,keepaspectratio]{example-image} & \includegraphics[width=2.75in,keepaspectratio]{example-image-b} \\
\end{longtable}
\end{document}


I added command \endlastfoot to create a special footer for the last page of the table, containing only \hline.

The resulting second pdf page is