[Tex/LaTex] longtable – strange lines at the end of table

longtablerulestables

I have strange problem with longtable package. Almost all my tables looks great but some of have strange lines at the end of tables. Please take a look at the picture

I create the table like that

    \begin{longtable}{|c|c|c|c|c|c|c|c|c|}
\caption{Wyniki rozpoznawania obrazów dla obrazu zapytania 004\_0001.jp w katalogu baseballbat}\\\hline
\multicolumn{2}{|c|}{\textbf{Obraz zapytanie}} & \multicolumn{3}{|c|}{\textbf{Obraz przetwarzany}} & \multicolumn{4}{|c|}{\textbf{Wynik}} \\
\hline
\textbf{Nazwa} & \textbf{N} & \textbf{Katalog} & \textbf{Nazwa} & \textbf{N} & \textbf{J} & \textbf{J} & \textbf{Czas} & \textbf{Gęstość} \\ \hline
054\_0020.jpg & 209 & ring &054\_0020.jpg & 209 & 10089.1  & celu & time & 0.98  \\ \hline
                  &  & ring  &054\_0002.jpg & 288 & 21585.7  & celu & time & 0.52  \\ \hline
                  &  & ring  &054\_0013.jpg & 213 & 10755.7  & celu & time & 0.43  \\ \hline \hline
                  &  & ring  &054\_0004.jpg & 250 & 15510.8 & celu & time & 0.43  \\ \hline
                  &  & ring  &054\_0011.jpg & 117 &  3599.62  & celu & time & 0.43  \\ \hline
                  &  & ring  &054\_0015.jpg & 256 & 13359.8  & celu & time & 0.43  \\ \hline
                  &  & ring  &054\_0019.jpg & 275 & 20456.9  & celu & time & 0.43  \\ \hline
                  &  & ring  &054\_0026.jpg & 209 & 7813.75  & celu & time & 0.43  \\ \hline
                  &  & ring  &054\_0028.jpg & 130 & 3307.91  & celu & time & 0.43  \\ \hline
                  &  & ring  &054\_0029.jpg & 275 & 17064.3 & celu & time & 0.43  \\ \hline
                  &  & ring  &054\_0037.jpg & 95  & 5653.98  & celu & time & 0.43  \\ \hline
                  &  & ring  &054\_0041.jpg & 234 & 9418.73  & celu & time & 0.43  \\ \hline
                  &  & ring  &054\_0042.jpg & 120 & 2643.69 & celu & time & 0.43  \\ \hline
                  &  & ring  &054\_0044.jpg & 114 & 2672.92 & celu & time & 0.43  \\ \hline
\label{tab:ring}
\end{longtable}

Can somebody tell me what is wrong with this code , that it produces this strange line

Best Answer

This is caused by the \label{tab:ring} at the end. It creates a new row, but only one column, so only the vertical lines of this column are drawn. You need to place it somewhere else, at best direct after \caption (but never before it) or in the firsthead (as the manual says) or as part of another box, before the last \\ \hline should be fine.

Related Question