I found that useful command \addlinespace[3pt]
to create an extra white border around the rows. See example:
\documentclass[a4paper]{report}
\usepackage{multirow,booktabs}
\usepackage[table]{xcolor}
\begin{document}
\begin{table}
\rowcolors{1}{gray!15}{gray!15}
\begin{tabular}{rrrrr}
\rowcolor{gray!50}
Header & 1 & 2 & 3 & 4 \\ \addlinespace[3pt]
Row1 & a & b & c & d \\
\multicolumn{1}{c}{} & a1 & b1 & c1 & d1 \\ \addlinespace[3pt]
\multicolumn{1}{c}{\multirow{-2}[0]{*}{Multirow1}} & a2 & b2 & c2 & d2 \\
Row2 & aa & ab & ac & ad \\
\end{tabular}
\end{table}
\end{document}
I also found commands like:
\setlength\extrarowheight{7pt}
\renewcommand\arraystretch{1.2}
here: vertical align and color in table with multirow
But these two commands seem to just expand the whole row rather than that white border thing. However, you call it 😉
As I have a lot of tables with loads of rows, my question is how to make the command \addlinespace[3pt]
globally so that I do not have to add it at the end of each single row for all tables.
Best Answer
I'm not so sure you want this additional space between all rows, particularly those where a
\multirow
is involved.However, stating
\global\everycr{\addlinespace[3pt]}
in the first cell will do; remember to restore\everycr
to its empty usual value at the end.Notice that I put a countermanding
\addlinespace
between the two rows sharing their label.