How can I use \multirow and \multicolumn simultaniously?

3,658

There's no need for \multirow:

\documentclass{article}
\usepackage{array}

\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}

\begin{document}

\begin{tabular}{|*{5}{C{.5in}|}}
\hline
& \multicolumn{2}{c|}{\bfseries 1} & \multicolumn{2}{c|}{\bfseries 2} \\
\cline{2-5}
  & 1 & 2 & 1 & 2 \\
\hline
1 & A & A & A & A \\
\hline
2 & B & B & B & B \\
\hline
3 & C & C & C & C \\
\hline
\end{tabular}

\end{document}

enter image description here

Share:
3,658

Related videos on Youtube

Dongkyu Sim
Author by

Dongkyu Sim

Updated on September 27, 2020

Comments

  • Dongkyu Sim
    Dongkyu Sim about 3 years

    I want to make below table using latex. But I don't know how to combine \multirow and \multicolumn. How can I make below table using latex?

    Thank you very much.

    enter image description here

    • egreg
      egreg about 7 years
      I see no need for \multirow.