eplain
has something that's somewhat similar to what you want.
\input eplain
\makecolumns 12/6:
A
B
C
D
E
F
G
H
I
J
K
L
It's not quite what you want.
\bye
memoir
has something similar.
\documentclass{memoir}
\begin{document}
\autorows{c}{6}{l}{
A, B, C, D, E, F, G, H, I, J, K, L%
}
\end{document}
Exactly what you're doing is fine, but your use of the multirow
package and associated \multirow
command is incorrect:
\documentclass{article}
\usepackage{multirow}% http://ctan.org/pkg/multirow
\begin{document}
\begin{tabular}{|l c c|}
\hline
Year & Objective & Training \\
\hline
\multirow{5}*{2011-2012} & Objective 1 & \multirow{2}*{Training 1} \\
& Objective 2 & \\
& Objective 3 & \multirow{3}*{Training 2} \\
& Objective 4 & \\
& Objective 5 & \\
\hline
\end{tabular}
\end{document}
In its simplest form, the use is \multirow{<num rows>}{<width>}{<stuff>}
where <num rows>
is an integer denoting the number of rows to spread <stuff>
across. A <width>
of *
denotes the natural width of <stuff>
.
Just in terms of presentation, you could also use booktabs
. The motivation being that vertical lines are not required since the structure inherent in a table is columnar, so there's no need to pursue the use of vertical rules:
\documentclass{article}
\usepackage{multirow}% http://ctan.org/pkg/multirow
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\begin{document}
\begin{tabular}{l c c}
\toprule
Year & Objective & Training \\
\midrule
\multirow{5}*{2011-2012} & Objective 1 & \multirow{2}*{Training 1} \\
& Objective 2 & \\
& Objective 3 & \multirow{3}*{Training 2} \\
& Objective 4 & \\
& Objective 5 & \\
\bottomrule
\end{tabular}
\end{document}
Following your edit, you can still specify integer values to have \multirow
entries in the way you present:
\documentclass{article}
\usepackage{multirow}% http://ctan.org/pkg/multirow
\begin{document}
\begin{tabular}{|l c c|}
\hline
Year & Objective & Training \\
\hline
\multirow{3}*{2011-2012} & Objective 1 & \multirow{2}*{Training 1} \\
& Objective 2 & \multirow{2}*{Training 2} \\
& Objective 3 & \\
\hline
\end{tabular}
\end{document}
Moreover, the same output as above is obtained if you even use a negative number of rows for \multirow
. That is, to use the following tabular
setup:
\begin{tabular}{|l c c|}
\hline
Year & Objective & Training \\
\hline
\multirow{3}*{2011-2012} & Objective 1 & \multirow{2}*{Training 1} \\
& Objective 2 & \\
& Objective 3 & \multirow{-2}*{Training 2}\\
\hline
\end{tabular}
Final edit update:
Centering content within a table is also possible via the m
-column type from the array
package. So, in order to duplicate the result (without colours and lines/rules), here's one way of doing it:
\documentclass{article}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\usepackage{array}% http://ctan.org/pkg/array
\newcolumntype{C}{@{}c@{}}
\begin{document}
\begin{tabular}{*{10}{>{\centering\arraybackslash}m{2em}}}
\toprule
A & B & C & D & E & F & G & H & I & J \\
\midrule
\begin{tabular}{C}1\end{tabular} &
\begin{tabular}{C}1\\2\end{tabular} &
\begin{tabular}{C}1\\2\\3\end{tabular} &
\begin{tabular}{C}1\\2\\3\\4\end{tabular} &
\begin{tabular}{C}1\\2\\3\\4\\5\end{tabular} &
\begin{tabular}{C}1\\2\\3\\4\\5\\6\end{tabular} &
\begin{tabular}{C}1\\2\\3\\4\\5\\6\\7\end{tabular} &
\begin{tabular}{C}1\\2\\3\\4\\5\\6\\7\\8\end{tabular} &
\begin{tabular}{C}1\\2\\3\\4\\5\\6\\7\\8\\9\end{tabular} &
\begin{tabular}{C}1\\2\\3\\4\\5\\6\\7\\8\\9\\10\end{tabular} \\
\bottomrule
\end{tabular}
\end{document}
Best Answer
You could achieve the double line by using
\hhline{#=#===#=#}
as inBut if you zoom out you'll see some weird details as the one inside the red circle (but visible along the lines):
But as you would read somewhere else, I'd advise against the use of vertical rules to improve readability. Not to mention that you would have a much cleaner code.
So this is my suggestion for your table. It uses the
booktabs
package which makes for much better lines:And the code: