[Tex/LaTex] Starred version of “xtabular” not working

page-breakingstarred-versiontables

I want to insert a long table in a two-column paper. I tried "tabular" first, but the problem is that it doesn't divide the table among pages. Then people in this post suggested that I use xtab:

How can I make a table that takes up more than a single page?

I tried it but, unfortunately, I got this error after adding the star to a working xtabular table:

./composition-body.tex:392: Missing number, treated as zero.
<to be read again> 
                   |
l.392     \hline

I didn't understand the error, especially that removing the star removes the error. After some search in the internet, I thought it might expect width, so I added {5in} just after \begin{xtabular*}. This solved the compiling problem, but LaTeX still tries to insert the table in a column as shown in the following two images:

enter image description here

enter image description here

Here is the LaTeX code in case you want to read it:

\tablecaption{The factors the camera solver depends on to evaluate the rules.}
\tablehead{\hline \textbf{Factor} & \textbf{Best Value} & \textbf{$\Delta_t$} & \textbf{$\Delta_{do}$} & \textbf{Explanation} \\}
\begin{xtabular*}{5in}{|c|c|c|c|p{3in}|}
    \hline
    %%% ----- Rule of Thirds (Corners) -----
    \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Rule of Thirds (Corners)} \\
    \hline
    Horizontal Distance to Corner   & 0     & HD/20         & HD        & The horizontal distance between the centre of mass of the object and the closest corner.                              \\
    \hline
    Vertical Distance to Corner     & 0     & HD/20         & HD        & The vertical distance between the centre of mass of the object and the closest corner.                                \\
    \hline
    %%% ----- Rule of Thirds (Lines) -----
    \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Rule of Thirds (Lines)} \\
    \hline
    Line Angle                      & 45    & 15            & 30        & The angle between the prominent line of the object and the diagonal lines                                             \\ % TODO: What object? Make sure it is clear.
    \hline
    Line Distance                   & 0     & 0.25          & 1         & The distance, in screen coordinates, from the prominent line of the object to the diagonal lines.                     \\ % TODO: Need to define screen coordinates
    \hline
    Corner Distances                & 0     & 0.1           & 0.7       & The distance, in screen coordinates, from the end of the prominent line of the object to the corners of the screen.   \\
    \hline
    %%% ----- Diagonal Dominance -----
    \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Diagonal Dominance} \\
    \hline
    Line Angle                      & 45    & 15            & 30        & The angle between the prominent line of the object and the diagonal lines                                             \\ % TODO: What object? Make sure it is clear.
    \hline
    Line Distance                   & 0     & 0.25          & 1         & The distance, in screen coordinates, from the prominent line of the object to the diagonal lines.                     \\ % TODO: Need to define screen coordinates
    \hline
    Corner Distances                & 0     & 0.1           & 0.7       & The distance, in screen coordinates, from the end of the prominent line of the object to the corners of the screen.   \\
    \hline
    %%% ----- Visual Balance -----
    \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Visual Balance} \\
    \hline
    Horizontal Center               & 0     & 0.1           & 0.5       & The horizontal component of the centre of mass of all the objects of the rule.                                        \\ % TODO: What does "objects" mean here? It should be well explained.
    \hline
    Vertical Center                 & 0     & 0.1           & 0.5       & The vertical component of the centre of mass of all the objects of the rule.                                          \\ % TODO: What does "objects" mean here? It should be well explained.
    \hline
    %%% ----- Boundary Rule -----
    \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Boundardy Rule} \\
    \hline
    Left Outside                    & 0     & 5\% BW        & 25\% BW   & The width of the part of the object which is beyond the left border of the boundary specified by the rule.            \\
    \hline
    Right Outside                   & 0     & 5\% BW        & 25\% BW   & The width of the part of the object which is beyond the right border of the boundary specified by the rule.           \\
    \hline
    Top Outside                     & 0     & 5\% BH        & 25\% BH   & The height of the part of the object which is beyond the upper border of the boundary specified by the rule.          \\
    \hline
    Bottom Outside                  & 0     & 5\% BH        & 25\% BH   & The height of the part of the object which is beyond the lower border of the boundary specified by the rule.          \\
    \hline
    %%% ----- Framing Rule -----
    \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Framing Rule} \\
    \hline
    Left Delta                      & 0     & 5\% FW        & 25\% FW   & The distance between the left of the object's frame and the left of the frame specified by the rule.                  \\
    \hline
    Right Delta                     & 0     & 5\% FW        & 25\% FW   & The distance between the right of the object's frame and the right of the frame specified by the rule.                \\
    \hline
    Top Delta                       & 0     & 5\% FH        & 25\% FH   & The distance between the top of the object's frame and the top of the frame specified by the rule.                    \\
    \hline
    Bottom Delta                    & 0     & 5\% FH        & 25\% FH   & The distance between the bottom of the object's frame and the bottom of the frame specified by the rule.              \\
    \hline
    %%% ----- Visibility Rule -----
    \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Visibility Rule (Full Visibility)} \\
    \hline
    Visibility                      & 100   & 5             & 50        & The percentage of the visible part of the object.                                                                     \\
    \hline
    %%% ----- Visibility Rule -----
    \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Visibility Rule (No Visibility)} \\
    \hline
    Visibility                      & 0     & 5             & 50        & The percentage of the visible part of the object.                                                                     \\
    \hline
    %%% ----- Position Rule -----
    \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Position Rule} \\
    \hline
    Horizontal Distance             & 0     & 0.01          & 0.25      & The horizontal distance between the centre of mass of the object and the position specified by the rule.              \\
    \hline
    Vertical Distance               & 0     & 0.01          & 0.25      & The vertical distance between the centre of mass of the object and the position specified by the rule.                \\
    \hline
    %%% ----- Size Rule -----
    \multicolumn{5}{|>{\columncolor[gray]{.8}}l|}{Size Rule} \\
    \hline
    Beyond Minimum Width            & 0     & 5\% AOW       & 25\% FW   & The amount the width of the object is beyond the minimum width.                                                       \\
    \hline
    Beyond Minimum Height           & 0     & 5\% AOH       & 25\% FH   & The amount the height of the object is beyond the minimum height.                                                     \\
    \hline
    Beyond Maximum Width            & 0     & 5\% AOW       & 25\% FW   & The amount the width of the object is beyond the maximum width.                                                       \\
    \hline
    Beyond Maximum Height           & 0     & 5\% AOH       & 25\% FH   & The amount the height of the object is beyond the maximum height.                                                     \\
    \hline
    \label{table:factors}
\end{xtabular*}

Best Answer

So far I understood the source code of xtab the xtabular* version simply uses tabular* internally, i.e. it allows you to set the table width explicitly. This caused your error when the width wasn't given. It apparently doesn't make the tabular span over two columns as it is mentioned in the manual!

My tip:

Put it back into a top float \begin{figure*}[t] to make it appear on top of the next page (or alternatively on the bottom). If the table is still longer than a page, break it down manually into two floats. I think for a paper this effort is acceptable and gives you the best result. For a multi-page (3+) table in a longer document I would do it differently.