# vertical align and color in table with multirow

I have the following table:

\documentclass[a4paper]{report}

\usepackage{booktabs}
\usepackage{multirow}
\usepackage[table]{xcolor}

\begin{document}

\begin{table}[htbp]
\centering
\begin{tabular}{l c c c}
\toprule
Group & Par. & Measure & Metric\\
\midrule
\rowcolor{gray!25} \cellcolor{white} Group 1 & & 1 &  $$Formula_1=\displaystyle\frac{A}{B}\cdot 2$$\\ \addlinespace[3pt]
\rowcolor{gray!25} \cellcolor{white} & F &  2 &  $$Formula_2=\displaystyle\frac{C}{D}\cdot 3.1$$ \\ \addlinespace[3pt]
\rowcolor{gray!25} \cellcolor{white} & & 3 & $$Formula_3=\displaystyle\frac{E}{F}\cdot 2$$\\  \addlinespace[3pt]

& E & 3b &\\
&  & 4 & $$Formula_4=\displaystyle\frac{G}{H}$$\\ \addlinespace[12 pt]

\rowcolor{gray!25} \cellcolor{white} Group 2 & & 5 & $$Formula_5=\displaystyle\frac{I}{J}$$\\ \addlinespace[3pt]
\rowcolor{gray!25} \cellcolor{white} & P & 6 & $$Formula_6=\displaystyle\frac{K}{L}$$\\ \addlinespace[3pt]
\rowcolor{gray!25} \cellcolor{white} & & 7 & $$Formula_7=M-N$$\\ \addlinespace[3pt]

& N & 7b &\\
& & 8 & $$Formula_8=\displaystyle\frac{O}{P}$$\\ \addlinespace[3 pt]

\bottomrule
\end{tabular}%
\caption{Hi, I am the caption.}
\label{measures}%
\end{table}%
\end{document}


That produce the following result:

The are two clear problems that I cannot overcome:

1. The ugly white space between the gray rows, due to "\addlinespace[3pt]", that in turns I have put to improve the fractions readability
2. The vertical space in the gray lines with equations: I wish they were not so close to the cell top and down borders (very clear in the first row: "A/B")

What I have tried so far:

• To solve the first problem nothing serious... I tried to play with "rowcolor" and "cellcolor", with no sensible effects...
• I tried to add "\vphantom{\Huge{A}}" before

\rowcolor{gray!25} \cellcolor{white} & F &  2 &\bigstrut  $$Formula_2=\displaystyle\frac{C}{D}\cdot 3.1$$ \\[3pt]
\rowcolor{gray!25} \cellcolor{white} & & 3 &\bigstrut $$Formula_3=\displaystyle\frac{E}{F}\cdot 2$$\\[7pt]

& & 3a &\\
& E & 3b &\\
&  & 4 &\bigstrut $$Formula_4=\displaystyle\frac{G}{H}$$\\[6 pt]

\rowcolor{gray!25} \cellcolor{white} Group 2 & & 5 &\bigstrut $$Formula_5=\displaystyle\frac{I}{J}$$\\[3pt]
\rowcolor{gray!25} \cellcolor{white} & P & 6 &\bigstrut $$Formula_6=\displaystyle\frac{K}{L}$$\\[3pt]
\rowcolor{gray!25} \cellcolor{white} & & 7 &\bigstrut $$Formula_7=M-N$$\\[7pt]

& & 7a &\\
& N & 7b &\\
& & 8 & $$Formula_8=\displaystyle\frac{O}{P}$$\\

\bottomrule
\end{tabular}%
\caption{Hi, I am the caption.}
\label{measures}%
\end{table}%

\end{document}

• Sorry, I did prepare the full example but I posted only the table :D I have corrected it. Thanks for the solution! – scannerdarkly Jul 19 '12 at 17:03