1

How to denote column and row like this?

enter image description here

Here is my code, but I am not able to replicate the table in the picture.

\begin{table}[ht]
    \large


\centering
\begin{tabular}{|c ||c | c |c |c | c | c |c | c | c |}
    \hline

%\multicolumn{}{c}{Area Range} & \\
%\cline{1-9}
    \parbox[t]{3mm} %{\multirow{8}{*}{\rotatebox[origin=c]{90}{\bf\underline{~No.of tasks}}}} 
      & \bf 0 & \bf 1 & \bf 2 & \bf 3 & \bf 4 &\bf 5 & \bf 6 &\bf 7  \\[1 ex] \hline
      \bf 0 & 0 &  0 &  0 &  0 & 0 & 0 & 0 & 0 \\ [1ex] \hline
     \bf 1 & 0 &  1 &  1 &  1 & 1 & 1 & 1 & 1\\ [1ex] \hline
    \bf 2 & 0 &  1 &  1 &  4 & 5 & 5 & 5 & 5 \\ [1ex] \hline
     \bf3 & 0 &  1 &  1 &  4 & 5 & 6 & 6 & 9 \\ [1ex] \hline
     \bf 4 & 0 &  1 &  1 &  4 & 5 & 7& 8 & \bf 9 \\ [1 ex] \hline
    \hline 
\end{tabular}

\end{table} 
  • 1
    Please provide a working document, not just fragments. And \bf is deprecated. Use \textbf{...} or `\bfseries – user31729 Apr 30 '16 at 9:15
2
\documentclass{article}

\usepackage{graphicx}
\usepackage{multirow}
\begin{document}



\begin{table}[ht]
  \large
  \centering
  \begin{tabular}{c|c||*{8}{c|}}
    \multicolumn{2}{c}{} & \multicolumn{8}{c}{Area Range} \tabularnewline
    \cline{2-10}
    \multirow{9}*{\rotatebox{90}{No. of tasks}} &
&    \bfseries 0 & \bfseries 1 & \bfseries 2 & \bfseries 3 & \bfseries 4 &\bfseries 5 & \bfseries 6 &\bfseries 7  \tabularnewline[1 ex] 
\cline{2-10}
&    \bfseries 0 & 0 &  0 &  0 &  0 & 0 & 0 & 0 & 0 \tabularnewline [1ex] 
    \cline{2-10}
&    \bfseries 1 & 0 &  1 &  1 &  1 & 1 & 1 & 1 & 1\tabularnewline [1ex] 
    \cline{2-10}
&    \bfseries 2 & 0 &  1 &  1 &  4 & 5 & 5 & 5 & 5 \tabularnewline [1ex] 
    \cline{2-10}
&    \bfseries 3 & 0 &  1 &  1 &  4 & 5 & 6 & 6 & 9 \tabularnewline [1ex] 
    \cline{2-10}
&    \bfseries 4 & 0 &  1 &  1 &  4 & 5 & 7& 8 & \bfseries 9 \tabularnewline [1 ex]
    \cline{2-10}
  \end{tabular}
\end{table} 
\end{document}

enter image description here

1

With \overbrace in math mode, you can add a big brace with some text or math symbols.

\documentclass{article}
\usepackage{graphicx,amsmath}
\usepackage{multirow,array}
\begin{document}

\begin{table}[ht]
  \large  
  \centering 
  \renewcommand{\arraystretch}{1.5}
  \begin{tabular}{c|c||*{8}{c|}}
    \multicolumn{2}{c}{} & \multicolumn{8}{@{}c}{$\overbrace{\rule{12.5em}{0pt}}^{J}$} \\
\cline{2-10}
&& \bfseries 0 & \bfseries 1 & \bfseries 2 & \bfseries 3 & \bfseries 4 &\bfseries 5 & \bfseries 6 &\bfseries 7  \\
\cline{2-10}
\multirow{5}*{\rotatebox{90}{$\overbrace{\rule{8.8em}{0pt}}^{I}$}}
&    \bfseries 0 & 0 &  0 &  0 &  0 & 0 & 0 & 0 & 0 \\ 
    \cline{2-10}
&    \bfseries 1 & 0 &  1 &  1 &  1 & 1 & 1 & 1 & 1 \\
    \cline{2-10}
&    \bfseries 2 & 0 &  1 &  1 &  4 & 5 & 5 & 5 & 5 \\ 
    \cline{2-10}
&    \bfseries 3 & 0 &  1 &  1 &  4 & 5 & 6 & 6 & 9 \\ 
    \cline{2-10}
&    \bfseries 4 & 0 &  1 &  1 &  4 & 5 & 7& 8 & \bfseries 9 \\ 
    \cline{2-10}
  \end{tabular}
\end{table} 
\end{document}

enter image description here

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.