# Drawing lines in tables?

I use the following code to draw a table:

\makebox[\textwidth]{%
\begin{tabularx}{\textwidth}{|X|S|S|S|S|S|X|}
\hline
& $--$ & $-$ & $-/+$ & $+$ & $++$ &\\
\hline
The necessary information was easy to find & $\square$ & $\square$ & $\square$ & $\square$ & $\square$ & The necessary information was hard to find\\
\hline
Information retrieval requires redundant user input  & $\square$ & $\square$ & $\square$ & $\square$ & $\square$ & Information retrieval does not require redundant user input\\
\\\hline
\end{tabularx}%
}


Now the table looks like this:

If I dont use the last \\\hline:

\makebox[\textwidth]{%
\begin{tabularx}{\textwidth}{|X|S|S|S|S|S|X|}
\hline
& $--$ & $-$ & $-/+$ & $+$ & $++$ &\\
\hline
The necessary information was easy to find & $\square$ & $\square$ & $\square$ & $\square$ & $\square$ & The necessary information was hard to find\\
\hline
Information retrieval requires redundant user input  & $\square$ & $\square$ & $\square$ & $\square$ & $\square$ & Information retrieval does not require redundant user input\\
\end{tabularx}%
}


It looks like this:

So how can I make the last line correctly?

-
What does columntype S mean? – Leo Liu Feb 17 '11 at 19:40
@Leo: see tex.stackexchange.com/q/11305/2975 – Martin Scharrer Feb 17 '11 at 19:41
Please always include the full, but minimal document, so that people can simply copy&paste it. It is normally only a few lines more... – Martin Scharrer Feb 17 '11 at 19:42

You have two \\ now:

... redundant user input\\
\\\hline
\end{tabularx}%


Before you had no \\:

... redundant user input
\hline
\end{tabularx}%


which causes the mentioned error.

You need only one \\:

... redundant user input\\
\hline
\end{tabularx}%


And then it works properly.

The reason why some lines are missing when you have two \\ is that the cells are not filled out, e.g. there are not & in the last row. The lines are only drawn with the cells. Therefore no cells -> no lines.

-