I would like to create a table like this:
+------------+----------+
| M1 | M2 |
+--------+------+-----+------+---+
| Prog | E | S | E | S |
+--------+------+-----+------+---+
| P1 | 1 | 5 | 0.6 | 10|
| P2 | 2 | 7 | 2 | 6 |
+--------+------+-----+------+---+
Based on the examples, I have written this
\begin{document}
\begin{table}
\centering
\caption{Multiprogram sets}
\label{multiprogram}
\begin{tabular}{c|c|c|c|c|}
\cline{2-5}
& \multicolumn{2}{|c|c|}{M1} & \multicolumn{2}{|c|c|}{M2} \\
\cline{2-5}
& E & S & E & S\\
\hline
\multicolumn{1}{|c|}{P1} & 1 & 5 & 0.6 & 10\\
\hline
\multicolumn{1}{|c|}{P2} & 2 & 7 & 2 & 6 \\
\end{tabular}
\end{table}
\end{document}
But it is not working and has many errors. How can I fix that?
\multicolumn{2}{|c|c|}{M1}
to\multicolumn{2}{|c|}{M1}
(and the same for the other cell withM2
). At least, this should solve the errors.