[Tex/LaTex] “Misplaced \noalign” error when compiling table made using \tabularx

aligntablestabularxvertical alignment

Can someone help me fix the problem?

\begin{table*}[t]
\centering
\caption{Message header fields (64-bit total)}
\label{table:header}
\begin{tabularx}{\textwidth}{|l|l|l|}
\hline
\multicolumn{1}{|c|}{{\bf Field}} & \multicolumn{1}{c|}{{\bf Length (bits)}} & \multicolumn{1}{c|}{{\bf Description}}                                                                          \\ \hline
Message type                      & 6                                        & UID representing type of message               \\ 
\hline
Priority                          & 3                                        & 0-7: A value representing the urgency of message.  \\ 
\hline
Checksum flag                     & 1                                        & Value . %Set to 0 if no checksum exists \\ 
\hline
state              & 8                                        & UID \\
\hline
Source            & 5                                        & UID                                                                               \\ 
\hline
Source unit number                & 5                                        & UID                                                                                   \\ \hline
Source            & 5                                        & UID                                                                              \\ \hline
Destination       & 5                                        & UID                                                                           \\ 
\hline
Destination         & 5                                        & UID                                                                           \\ \hline
Destination     & 5                                        & UID                                                                          \\ \hline
Application & 16                                       & Representing length                                       \\ 
\hline
\end{tabularx}
\end{table*}

Best Answer

You should change the line

Checksum flag                     & 1                                        & Value is set to 1 if the data is followed by a 16-bit checksum. %Set to 0 if no checksum exists \\ 

onto

Checksum flag                     & 1                                        & Value is set to 1 if the data is followed by a 16-bit checksum.  \\ %Set to 0 if no checksum exists

In your version \\ is commented and LaTeX has more than 3 columns to align in your tabular.

Related Question