TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I draw a tabular like below using the given script.

below

\documentclass[12pt]{article}
\usepackage{multirow}
\usepackage{colortbl}

\begin{document}

\begin{figure}
  \centering
  \begin{tabular}{|*{10}{c|}}
    \hline
    \multicolumn{2}{|>{}c|}{} & \multicolumn{3}{c|}{TOP.1} & \multicolumn{3}{c|}{TOP.2} \\
    \arrayrulecolor{black}
    \cline{3-8}
    \multicolumn{2}{|>{}c|}{} & TOP.1.1 & TOP.1.2 & TOP.1.3 & TOP.2.1 & TOP.2.2 & TOP.2.3\\
    \hline

    \multirow{3}{*}{SIDE.1}
    & SIDE.1.1 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
    & SIDE.1.2 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
    & SIDE.1.3 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
    \hline

    \multirow{3}{*}{SIDE.2}
    & SIDE.2.1 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
    & SIDE.2.2 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
    & SIDE.2.3 & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{2-8}
    \hline

  \end{tabular}
\end{figure}

\end{document}
share|improve this question
up vote 4 down vote accepted
\documentclass[12pt]{article}
\usepackage{multirow}
\usepackage{rotating}

\begin{document}

\begin{figure}
    \centering
    \begin{tabular}{ccccccccc}
        \cline{4-9}
        \multicolumn{3}{c}{} & \multicolumn{6}{|c|}{TOPS} \\ \hline
        \multicolumn{1}{|c}{\multirow{8}{*}{\begin{sideways}SIDES\end{sideways}}} & \multicolumn{2}{|c}{} & \multicolumn{3}{|c}{TOP.1} & \multicolumn{3}{|c|}{TOP.2} \\ \cline{4-9}
        \multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{2}{|c}{} & \multicolumn{1}{|c}{TOP1.1} & \multicolumn{1}{|c}{TOP1.2} & \multicolumn{1}{|c}{TOP1.3} & \multicolumn{1}{|c}{TOP2.1} & \multicolumn{1}{|c}{TOP2.2} & \multicolumn{1}{|c|}{TOP2.3} \\ \cline{2-9}
        \multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{SIDE.1}} & \multicolumn{1}{|c}{SIDE1.1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \cline{3-9}
        \multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{}} & \multicolumn{1}{|c}{SIDE1.2} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \cline{3-9}
        \multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{}} & \multicolumn{1}{|c}{SIDE1.3} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \cline{2-9}
        \multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{SIDE.2}} & \multicolumn{1}{|c}{SIDE2.1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \cline{3-9}
        \multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{}} & \multicolumn{1}{|c}{SIDE2.2} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \cline{3-9}
        \multicolumn{1}{|c}{\multirow{8}{*}{}} & \multicolumn{1}{|c}{\multirow{3}{*}{}} & \multicolumn{1}{|c}{SIDE2.3} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c}{1} & \multicolumn{1}{|c|}{1} \\ \hline
    \end{tabular}
\end{figure}

\end{document}

resulting in: enter image description here

share|improve this answer

This is a possible solution.

enter image description here

Code

\documentclass[border=10pt]{standalone}
%\usepackage[landscape]{geometry}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{colortbl}

\begin{document}

%\begin{figure}
        \centering
  \begin{tabular}{ccc|*{6}{c|}}   \cline{4-9}
                                  & &                                     &\multicolumn{6}{c|}{Tops}\\ \hline
 \multicolumn{1}{|c}{\multirow{8}{*}{\rotatebox[origin=cc]{270}{Slides} }  } &   \multicolumn{2}{|c|}{} & \multicolumn{3}{c|}{TOP.1} & \multicolumn{3}{c|}{TOP.2} \\
    \arrayrulecolor{black}    \cline{4-9}
 \multicolumn{1}{|c}{}    &   \multicolumn{2}{|c|}{} & TOP.1.1 & TOP.1.2 & TOP.1.3 & TOP.2.1 & TOP.2.2 & TOP.2.3\\
    \cline{2-9}
 \multicolumn{1}{|c}{}    &   \multicolumn{1}{|c}{\multirow{3}{*}{SIDE.1}}  & \multicolumn{1}{|c|}{SIDE.1.1} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9}
 \multicolumn{1}{|c}{}    &  \multicolumn{1}{|c}{}&  \multicolumn{1}{|c|}{SIDE.1.2} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9}
 \multicolumn{1}{|c}{}    &  \multicolumn{1}{|c}{} &  \multicolumn{1}{|c|}{SIDE.1.3} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9}    \cline{2-9}
 \multicolumn{1}{|c}{}     &  \multicolumn{1}{|c}{\multirow{3}{*}{SIDE.2}}    &  \multicolumn{1}{|c|}{SIDE.2.1} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9}
 \multicolumn{1}{|c}{}     & \multicolumn{1}{|c}{} &  \multicolumn{1}{|c|}{SIDE.2.2} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9}
 \multicolumn{1}{|c}{}     & \multicolumn{1}{|c}{} &  \multicolumn{1}{|c|}{SIDE.2.3} & 1 & 1 & 1 & 1 & 1 & 1 \\ \cline{3-9}    \hline
  \end{tabular}
%\end{figure}

\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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