# “misplaced \noalign” error and missing column separator in “\tabular” environment

I am trying to a make a simple table in a document and I am having a few problems. I am somewhat new to LaTeX, so this is probably a stupid question!

1) I am trying to have a vertical line separating each column, but for whatever reason, it never draws the line between the first and second columns.

2) When I try to limit the size of a column with the p{<column width>} option, it simply doesn't work.

Here is a simplified version of my table:

\documentclass{report}
\begindocument
\begin{tabular}{l p{2cm} | c p{3cm} | c p{2cm} |}
\hline
First Column Description & Second Column Description & Third Column Description
\hline
\hline
First Column First Row Contents & Second Column First Row Contents & Third Column First Row Contents \\[3pt]
\hline
First Column Second Row Contents & Second Column Second Row Contents & Third Column Second Row Contents \\[3pt]
\hline
First Column Third Row Contents & Second Column Third Row Contents & Third Column Third Row Contents \\[3pt]
\hline
First Column Fourth Row Contents & Second Column Fourth Row Contents & Third Column Fourth Row Contents \\[3pt]
\hline
First Column Fifth Row Contents & Second Column Fifth Row Contents & Third Column Fifth Row Contents \\[3pt]
\hline
First Column Sixth Row Contents & Second Column Sixth Row Contents & Third Column Sixth Row Contents
\hline
\end{tabular}
\end{document}


Also, when I tried to run this sample through LaTeX, there are even more errors and it looks even more jumbled than in the original document. I can provide the original table also, although apart from the content, I am pretty sure they are identical

Also, here are the errors I am getting:

Misplaced \noalign.
\hline ->\noalign
{\ifnum 0=}\fi \hrule \@height \arrayrulewidth \futurelet...
l.111 \hline

?
./chapters/chapter2.tex:111: You can't use \hrule' here except with leaders.
\hline ->\noalign {\ifnum 0=}\fi \hrule
\@height \arrayrulewidth \futurelet...
l.111 \hline

?
./chapters/chapter2.tex:111: Missing number, treated as zero.
\futurelet
l.111 \hline

?
./chapters/chapter2.tex:111: Illegal unit of measure (pt inserted).
\futurelet
l.111 \hline

• Sorry, the carriage returns in my sample didn't show up in the post! – Paul Apr 20 '14 at 13:07

1. You need braces in \begin{document}.
2. You have three columns, but {l p{2cm} | c p{3cm} | c p{2cm} |} tells tabular to expect six.
3. You need \\ at the end of the first and last rows.

EDIT

To adjust the alignment of the text inside a p column, you can use \centering, \raggedleft and \raggedright inside the table entries. Note that you need braces if you do this in the final column. To change the alignment for an entire column, you can use the array package, as suggested by @Bernard in the comments.

\documentclass{report}
\begin{document}
\begin{tabular}{p{2cm}|p{3cm}|p{2cm}|}
\hline
\centering First Column Description & \raggedright Second Column Description & {\raggedleft Third Column Description} \\
\hline
\hline
First Column First Row Contents & Second Column First Row Contents & Third Column First Row Contents \\[3pt]
\hline
First Column Second Row Contents & Second Column Second Row Contents & Third Column Second Row Contents \\[3pt]
\hline
First Column Third Row Contents & Second Column Third Row Contents & Third Column Third Row Contents \\[3pt]
\hline
First Column Fourth Row Contents & Second Column Fourth Row Contents & Third Column Fourth Row Contents \\[3pt]
\hline
First Column Fifth Row Contents & Second Column Fifth Row Contents & Third Column Fifth Row Contents \\[3pt]
\hline
First Column Sixth Row Contents & Second Column Sixth Row Contents & Third Column Sixth Row Contents \\
\hline
\end{tabular}
\end{document}

• Wow, thanks @IanThompson. Now it is working perfectly. So I suppose the p{<column width>} option overrides any flush left/center/right options, so that an additional "l" option for flush left, for example, would be interpreted as an additional column. If this is the case, how would one flush right or center the contents of a column whose width has been specified by p{<column width>}? – Paul Apr 20 '14 at 13:38
• Load the array package and add >{\raggedleft} or >{\centering} in front of the p{…} specifier. Or even define new column types with \newcolumntype{K}{>{\centering}p{…}}` Then you can use the K specifier in tabulars (I didn't name it C, as some packages already define C specifiers). – Bernard Apr 20 '14 at 15:50