34

Unfortunately I cannot solve the error with noalign on my own:

! Misplaced \noalign.
\hline ->\noalign 
                  {\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet...
l.12 ... & \centering{B} & \centering{C} \\ \hline

I expect to see \noalign only after the \cr of
an alignment. Proceed, and I'll ignore this case.

I already tried it with \cline, but this didn't work either. By searching the web I found out that in all cases \\ at the end of the line is missing. However, I have a \\ at the end of the line:

\documentclass[12pt,a4paper]{article}
\usepackage{multicol}
\usepackage{multirow}

\begin{document}

\begin{tabular}{|p{40pt} p{60pt}|p{120pt}|}
\hline
\multicolumn{3}{|p{220pt}|}{\multirow{2}{220pt}{\centering{\textbf{Title}}}} \\
\multicolumn{3}{|c|}{} \\ \hline
\centering{A} & \centering{B} & \centering{C} \\ \hline
\end{tabular}

\end{document}

I'd appreciate any help.

  • 5
    Welcome to TeX.sx! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. – Kurt Apr 17 '13 at 12:03
  • I had the same error but under different circumstances. The reason in my case was that I had forgotten a \\ at the end of a row before an \hline. Just in case it helps someone else! – tremby Feb 19 at 23:06
33

\centering does not take an argument so as you used it its scope reaches to the end of the cell, but it redefines \\ to be a centred new line so you can use the unambiguous form of the array row separator: \tabularnewline

\documentclass[12pt,a4paper]{article}
\usepackage{multicol}
\usepackage{multirow}

\begin{document}

\begin{tabular}{|p{40pt} p{60pt}|p{120pt}|}
\hline
\multicolumn{3}{|p{220pt}|}{\multirow{2}{220pt}{\centering \textbf{Title}}} \tabularnewline
\multicolumn{3}{|c|}{} \\ \hline
\centering A & \centering B & \centering C \tabularnewline \hline
\end{tabular}

\end{document}
6

This seems to be caused by the \centering in the very last cell of your table. I do not know exactly why this fails, but if you centre C manually, the problem goes away.

\documentclass[12pt,a4paper]{article}
\usepackage{multicol}
\usepackage{multirow}

\begin{document}

\begin{tabular}{|p{40pt} p{60pt}|p{120pt}|}
\hline
\multicolumn{3}{|p{220pt}|}{\multirow{2}{220pt}{\centering{\textbf{Title}}}} \\
\multicolumn{3}{|c|}{} \\ \hline
\centering{A} & \centering{B} & \hfil C \hfil \\ \hline

\end{tabular}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.