I want to create multi-row tables. Here is the baseline table.
documentclass[prodmode,acmtecs]{acmsmall} % Aptara syntax
\usepackage[ruled]{algorithm2e}
\usepackage{multirow}
\begin{document}
\section{Introduction}
\begin{table}[!t]
\tbl{The caption.\label{cap}}
{\begin{tabular}{p{2.0cm}p{3.0cm}p{3.5cm}p{1.0cm}p{0.8cm}p{0.8cm}}
\hline
\textbf{Workload} & \textbf{Description} & \textbf{Input} & \textbf{Miss Ratio} & \textbf{MPKI} & \textbf{LPKI} \\
\hline
A & B & C & 1 & 2 & 3 \\
\hline
D & E & F & 4 & 5 & 6 \\
\hline
G & H & I & 7 & 8 & 9 \\
\hline
J & K & L & 10 & 11 & 12 \\
\hline
M & N & O & 13 & 14 & 15 \\
\hline
P & Q & R & 16 & 17 & 18 \\
\hline\hline
S & T & U & 19 & 20 & 21 \\
\hline
V & W & X & 22 & 23 & 24 \\
\hline
Y & Z & AA & 25 & 26 & 27 \\
\hline
AB & AC & AD & 28 & 28 & 29 \\
\hline
AE & AF & AG & 30 & 31 & 32 \\
\hline
AH & AI & AJ & 33 & 34 & 35 \\
\hline\hline
AK & AL & AM & 36 & 37 & 38 \\
\hline
AN & AO & AP & 39 & 40 & 41 \\
\hline
\end{tabular}}
\end{table}
\medskip
\end{document}
The output is
Now I want to divide the workload
column into two columns. SOmething like this
+-----------------+----
| workload
+----------+-----------
| | A
| | D
| group1 | G
| | J
| | M
| | P
-----------------------
-----------------------
| | S
| | V
| group2 | Y
| | AB
| | AE
| | AH
-----------------------
-----------------------
| | AK
| group3 | AN
-----------------------
So I added another column on the tabular line by increasing 6{}p to 7p{} and added these lines
\multirow{6}{*}{group1} & A & B & C & 1 & 2 & 3 \\
...
\multirow{6}{*}{group2} & S & T & U & 19 & 20 & 21 \\
...
\multirow{2}{*}{group3} & AK & AL & AM & 36 & 37 & 38 \\
But the result is far beyond expectation. In fact, I don't see any row span!!
UPDATE
After applying the method in the answer and replacing the A, B, … with real text, I see this output
Instead on \addlinespace
, I used \hline
. As you can see there is a gap between rows in each group.
Best Answer
Horizontal lines should be used to structure the content, but whitespace on the right place can do the same. Have a look at the table, it looks cleaner. Please note the little white space before/after the rules.
Package
siunitx
helps us here to align the numbers at the decimal mark.I am not quite sure i get the problem. I tried to construct a situation, but without succes. Right now i cannot reproduce the behaviour. Be aware, that
multirow
always requires manual labor. Please note, that i used\midrule
s again for their better spacing.Please consider the following