Here is the code for my table
Code: Select all
\documentclass[a4paper,10pt]{article}
\usepackage{rotating}
\usepackage[square, numbers, comma, sort & compress]{natbib}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{multirow}
\usepackage{rotating}
\begin{document}
\setlength\tabcolsep{1pt}
\newcommand*\MonthLetters{JFMAMJJASOND}
\newcommand*\NumMonths{27}
\newcommand*\YearMonths{12,12,3,}
\newcommand*\FirstYear{2009}
\makeatletter
\newcommand*\YearHeadRow{%
\expandafter\TL@year@head\number\numexpr\FirstYear\expandafter\relax\expandafter\@nil\YearMonths\@nil
}
\def\TL@year@head#1\@nil#2,#3\@nil{%
&\multicolumn{#2}{c|}{#1}%
\ifx\\#3\\\else
\TL@after@fi\TL@year@head\number\numexpr#1+1\relax\@nil#3\@nil
\fi
}
\newcommand*\YearMonthSep[1]{%
\cline{\numexpr#1+1\relax-\numexpr#1+\NumMonths\relax}%
}
\newcommand*\MonthHeadRow{%
\expandafter\TL@month@head\expandafter\@ne\expandafter\@nil\MonthLetters\@nil
}
\def\TL@month@head#1\@nil#2#3\@nil{%
%
\ifnum\NumMonths>#1 %
\TL@after@fi\TL@month@head\number\numexpr#1+1\relax\@nil#3#2\@nil
\fi
}
\newcount\TL@block@first
\newcount\TL@block@last
\newcommand*\NewBlock[3]{%
\xglobal\colorlet{TL@block}{#1}%
\global\TL@block@first\numexpr#2-1\relax
\global\TL@block@last\numexpr#3+1\relax
\ignorespaces
}
\newcount\TL@row
\newcommand*\Row[1]{%
\global\advance\TL@row\@ne
\number\TL@row%
\TL@cell\@ne
\\\hline
}
\def\TL@cell#1{%
&%
\ifnum#1>\TL@block@first
\ifnum#1<\TL@block@last
\cellcolor{TL@block}%
\fi
\fi
\ifnum\NumMonths>#1 %
\expandafter\TL@cell\expandafter{\number\numexpr#1+1\expandafter}%
\fi
}
\def\TL@after@fi#1\fi{\fi#1}
\makeatother
\begin{table}
\caption{Proposed Reseacrh Timeline}
\label{minetimeline}
\begin{tabular}{|c|p{120pt}|*{\NumMonths}{c|}}
\hline
\multirow{2}{*}{\#} & \multirow{2}{*}{Tasks} \YearHeadRow \\
\YearMonthSep{2}
& \MonthHeadRow \\
\hline
%%%%%%%%%%%%
\NewBlock{blue}{1}{\NumMonths}
\Row{Literature Review}
%%%%%% 1 %%%%%%%
\NewBlock{yellow}{1}{2}
\Row{Confirmation Exam}
%%%%%% 6 %%%%%%% 4
\NewBlock{gray}{3}{5}
\Row{PIV setup}
\Row{PIV on $c/t = 7$ with \& without splitter plate}
\NewBlock{gray}{5}{6}
\Row{PIV data analysis \& comparison}
\Row{Explanation of Feedback Loop}
%%%%%% 10 %%%%%%% 5
\NewBlock{green}{7}{9}
\Row{LDV construction of c/t vs St; $c/t = 3-12$}
\Row{LDV results analysis}
\NewBlock{green}{5}{12}
\Row{PIV experiment on $c/t = 8-9$ and construction}
\Row{LDV \& PIV data analyze \& comparison}
\Row{Stepwise variation explanation}
%\Row{Publication 01}
%%%%%% 8 %%%%%%% 3
\NewBlock{orange}{7}{12}
\Row{Construction of plates with different geometries}
\NewBlock{orange}{12}{15}
\Row{PIV on square edges with \& without splitter, aerofoil leading-square trailing edge with \& without splitter}
\NewBlock{orange}{15}{16}
\Row{PIV data analyze and comparison}
% \Row{Publication 02}
%%%%%%% 7 %%%%%% 3
\NewBlock{blue}{17}{18}
\Row{PIV with global oscillation with \& without perturbation}
\NewBlock{blue}{18}{20}
\Row{PIV with separate perturbation on aerofoil leading edge \& aerofoil trailing edge}
\Row{Perturbation data analyze and comparison}
% \Row{Publication 03}
%%%%%%%%%% 4 %%%%%%%%%%% 2
\NewBlock{green}{15}{21}
\Row{Pressure probe construction}
\NewBlock{green}{20}{22}
\Row{Pressure measurement on $c/t$ = 7 with \& without splitter plate}
\Row{Pressure data analyze}
%\Row{Publication 04}
%%%%%%%%% 1 %%%%%%%%%%%%
\NewBlock{red}{18}{27}
\Row{Thesis writing}
\end{tabular}
\end{table}
\end{document}
The current task number is in the format of 1, 2, 3, 4...20 (in the above code) but I want it as 1.1, 1.2, 1.3...2.1, 2.2 and so on to reflect the task group as well. How to do it?
Please let me know if the problem is not well explained. Any suggestion would be highly appreciated.
Thanks!