[Tex/LaTex] Set longtable to fit the page-width

fitlongtabletableswidth

I would like to set a longtable to fit correctly the page-witdh. From now, I've this situation:

longtable-width-error

and the related tex code is:

\usepackage{array}
\usepackage{multirow}
\usepackage{longtable}
\usepackage[tableposition=below]{caption}

[…]

We now present a table that summarises the possible scenarios that can happen in the overlap zone.
{\small \begin{center}
\begin{longtable}{|c|c|c|}

\hline \textbf{Type of movement in the overlap zone} & \textbf{State of the object in camera 1} & \textbf{State of the object in camera 2}  \\ \hline
\endfirsthead

\hline \textbf{Type of movement in the overlap zone} & \textbf{State of the object in camera 1} & \textbf{State of the object in camera 2}  \\ \hline
\endhead

\hline
\caption{Table title.}
\endfoot

\caption{Table title.}
\endlastfoot

Object moving from camera 1 to camera 2 & Object will eventually be in the \emph{exiting} state and the be \emph{deleted} & Object will be recognised as a \emph{new} object, then become \emph{to be classified} and eventually \emph{classified} \\ \hline
\end{longtable}  
\end{center}
}

How can I fix the error?

Best Answer

Use the tabu with its environment

\begin{longtabu} to \textwidth {|X|X|X|}
…
\end{longtabu}

For more information, see the documentation of tabu.

Related Question