# Supertabular does not work correctly with images

When I insert images in Supertabular to break them automatically across pages, supertablur does not work correctly.

1. Table caption remains on the first page!
2. The images do not break across pages!

The MWE is as follows:

\documentclass{article}

\usepackage{graphicx}
\usepackage{supertabular}

\begin{document}

\tablecaption{Testing Supertabular}
{\bfseries row&\bfseries  Image\\ \hline}
\tabletail
{\hline \multicolumn{2}{r}{\emph{Continued on next page}}\\}
\tablelasttail{\hline}

\begin{supertabular}{cc}
\hline
1 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
2 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
3 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
4 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
5 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
6 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
7 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
\end{supertabular}

\end{document}


Supertabular isn't very good at this. Its calculation of the required space assumes that each row has a "normal" height (one line of text), unless there is a p{} column, in which case the height of the resulting \parbox is measured. So in this case it thinks the table is 7 lines high and that would fit on the page. So it puts everything in a single tabular. But then TeX's page breaking algorithm finds that this tabular is too large for the page and puts it on the next page. You can help supertabular by using a p specifier for the second column.

\begin{supertabular}{cp{.5\textwidth}}


Another option is toi use longtable instead of supertabular. In general I find longtable more reliable than supertabular.

\documentclass{article}

\usepackage{graphicx}
\usepackage{longtable}

\begin{document}

\begin{longtable}{cc}
\caption{Testing Longtable} \\
\hline \multicolumn{2}{r}{\emph{Continued on next page}}\\ \endfoot
\hline \endlastfoot
\hline
1 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
2 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
3 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
4 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
5 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
6 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
7 & \includegraphics[width=.5\textwidth]{example-image-a} \\ \hline
\end{longtable}

\end{document}