编译使用 \tabularx 制作的表格时出现“Misplaced \noalign”错误

编译使用 \tabularx 制作的表格时出现“Misplaced \noalign”错误

有人能帮我解决这个问题吗?

\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*}

答案1

你应该改变路线

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 \\ 

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

您的版本中\\有注释,并且 LaTeX 表格中有超过 3 列需要对齐。

相关内容