I was preparing some exercises with tables for beginners, without resorting to additional packages.
I found this anomaly in a multi-column tabular that distilled to its simplest is
\documentclass{article}
\begin{document}
\section{Wrong}
\begin{tabular}{|c|*{12}{c|}}
\hline
x2 col & \multicolumn{2}{c|}{1x2a} & \multicolumn{2}{c|}{1x2b} & \multicolumn{2}{c|}{1x2c} & \multicolumn{2}{c|}{1x2d} & \multicolumn{2}{c|}{1x2e} & \multicolumn{2}{c|}{1x2f}\ \hline
x3 col & \multicolumn{3}{c|}{1x3a} & \multicolumn{3}{c|}{1x3b} & \multicolumn{3}{c|}{1x3c} & \multicolumn{3}{c|}{1x3d} \ \hline
\end{tabular}%
\section{Right}
\begin{tabular}{|c|*{12}{c|}}
\hline
x2 col & \multicolumn{2}{c|}{1x2a} & \multicolumn{2}{c|}{1x2b} & \multicolumn{2}{c|}{1x2c} & \multicolumn{2}{c|}{1x2d} & \multicolumn{2}{c|}{1x2e} & \multicolumn{2}{c|}{1x2f}\ \hline
x4 col & \multicolumn{4}{c|}{1x4a} & \multicolumn{4}{c|}{1x4b} & \multicolumn{4}{c|}{1x4c} \ \hline
\end{tabular}
\end{document}
Multi-column cells \multicolumn{3}{c|}{…} in the first tabular don't span three columns; while in the second, similar, tabular works fine.
I found a recent reference on this site (resolved by adding a single empty row) but frankly I don't understand why this is happening.
I'm looking for an explanation with “predictive” powers to teach others. How can one decide a priori (before compiling) if a particular tabular needs to be corrected?









multicolumn{2}{c|}...}wrappers in the upper row and replace the\multicolumn{4}{c|}{...}with\multicolumn{2}{c|}{...}directives in the secod row. – Mico Feb 02 '23 at 20:06\multicolumn). If you add a normal row, like1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\\it works. – Pieter van Oostrum Feb 02 '23 at 20:33