1

enter image description here

Hi, I'm facing problem to build this table. Kindly give me quick response as possible. So fa I try the following:

\documentclass{article}

% Definitions
\usepackage{lscape}
\usepackage[height=25cm]{geometry}
\usepackage{timetable}
\usepackage{array}
\usepackage{multirow}

\begin{document}
\begin{table}[htbp]
  \centering
  %\caption{Add caption}
    \begin{tabular}{|c|c|c|c|c|c|c|}
    \hline
    \multirow{3}[4]{*}{S.No} & \multirow{4}[5]{*}{Activity} & \multicolumn{4}{c|}{\multirow{2}[2]{*}{2017 }}\\
         & \multicolumn{5}{c|}{} \\
\cline{2-3} & \cline{3-5}           & Feb-Mar   & Apr-Jun    & Jul-Sept    & Oct-Dec   \\
    \hline
     1& Literature on Polynomial Optimization   &       &       &       &        \\
    \hline
     2&Solution to Question 1A   &       &       &       &        \\
    \hline
     3&Solution to Question 1b    &       &       &       &       \\
    \hline
     4& Solution to Question 2  &       &       &       &        \\
    \hline
     5& Conjecture    &       &       &       &        \\
    \hline
    \end{tabular}%
  \label{tab:addlabelkiki}%
\end{table}%
\end{document} 

\documentclass{article}

% Definitions
\usepackage{lscape}
\usepackage[height=25cm]{geometry}
\usepackage{timetable}
\usepackage{array}
\usepackage{multirow}

\begin{document}
\begin{table}[htbp]
  \centering
  %\caption{Add caption}
    \begin{tabular}{|c|c|c|c|c|c|c|}
    \hline
    \multirow{3}[4]{*}{S.No} & \multirow{4}[5]{*}{Activity} & \multicolumn{4}{c|}{\multirow{2}[2]{*}{2017 }}\\
         & \multicolumn{5}{c|}{} \\
\cline{2-3} & \cline{3-5}           & Feb-Mar   & Apr-Jun    & Jul-Sept    & Oct-Dec   \\
    \hline
     1& Literature on Polynomial Optimization   &       &       &       &        \\
    \hline
     2&Solution to Question 1A   &       &       &       &        \\
    \hline
     3&Solution to Question 1b    &       &       &       &       \\
    \hline
     4& Solution to Question 2  &       &       &       &        \\
    \hline
     5& Conjecture    &       &       &       &        \\
    \hline
    \end{tabular}%
  \label{tab:addlabelkiki}%
\end{table}%
\end{document} 

Actually This is what I tried.

2
  • 6
    Welcome to TeX.sx. You might want to check out our TeX.SX starter guide. Please show a minimal working document that shows what you have tried and what are the specific problems you are having. (And asking for a "quick response" to an all volunteer site is not a promising way to encourage answers...)
    – Alan Munn
    Jul 25, 2017 at 16:36
  • 1
    It seems that the \usepackage{tabularx} and \usepackage[table]{xcolor} in preamble of your document would be handy to write your table.
    – Zarko
    Jul 25, 2017 at 16:55

1 Answer 1

2

enter image description here

\documentclass{article}

% Definitions
\usepackage[margin=2cm]{geometry}
\usepackage[table]{xcolor}
\usepackage{array,
            makecell, multirow, 
            tabularx}
\renewcommand\theadfont{\small\bfseries}

\begin{document}
    \begin{table}[ht]
\caption{Add caption}
    \small
    \sffamily
    \centering
\renewcommand\arraystretch{1.2}
    \begin{tabularx}{\linewidth}{|c|>{\raggedright}p{11em}|*{9}{>{\centering\arraybackslash}X|}}
    \cline{3-11}
\multicolumn{2}{c|}{}
        &   \multicolumn{4}{c|}{\thead{2017}}
            &   \multicolumn{4}{c|}{\thead{2018}}
                &   \thead{2019}                            \\
    \hline
\thead{S.\\ No}
    &   \thead{Activity}
        &   \thead{Feb -\\ Mar}
            &   \thead{Apr -\\ Jun}
                &   \thead{Jul -\\ Sep}
                    &   \thead{Oct -\\ Dec}
        &   \thead{Jan -\\ Mar}
            &   \thead{Apr -\\ Jun}
                &   \thead{Jul -\\ Sep}
                    &   \thead{Oct -\\ Dec} 
        &   \thead{Jan -\\ Mar}                             \\      
    \hline
1   &   Literature on Polynomial Optimization   
        &   \cellcolor{gray!30}       
            &   \cellcolor{gray!30}
                &   &   &   &   &   &   &                   \\
    \hline
2   &   Solution to Question 1A   
        &   &   \cellcolor{gray!30}
                &   \cellcolor{gray!30}
                    &   &   &   &   &   &                   \\
    \hline
3   &   Solution to Question 1B    
        &   &   &   \cellcolor{gray!30}
                    &   \cellcolor{gray!30}
                        &   &   &   &   &                   \\
    \hline
4   &   Solution to Question 2  
        &   &   &   &  \cellcolor{gray!30}
                        &   \cellcolor{gray!30}
                            &   &   &   &                   \\
    \hline
5   &   Conjecture
        &   &   &   &  \cellcolor{gray!30}
                        &   \cellcolor{gray!30}
                            &   \cellcolor{gray!30}
                                &   &   &                   \\
    \hline
6   &   Thesis Writing
        &   &   &   &   &  \cellcolor{gray!30}
                            &   \cellcolor{gray!30}
                                &   &   &                   \\
    \hline
    \end{tabularx}%
  \label{tab:addlabelkiki}%
\end{table}%
\end{document} 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .