In a tabular
environment, \\[
<spacing>]
does not always insert the requested spacing between rows containing themselves tabular
s. For instance, the two horizontal lines should not be aligned in the example below. The command \\[
<spacing>]
seems to work only when the spacing requested is larger than the height of the second line.
I have found two solutions:
- Insert a void row, i.e. replace
\\[5pt]
by\\[-12pt]&\\[5pt]
(for two columns), where12pt
is the value of\baselineskip
; - Replace
\\[5pt]
by the command\addlinespace[5pt]
of thebooktabs
package.
In his comments to the similar problem mentionned in Vertical skip between p{...} rows of tabular, David Carlisle does not seem very optimistic about this, but still,
would it be possible to redefine \\
so that it automatically does the right thing in tabular
s, without loading an extra package? Even if there is no solution, it may be worth to ask the question in case some other user faces the same problem...
Example:
\documentclass{article}
\begin{document}
\begin{tabular}[t]{ll}
a &
\begin{tabular}[t]{@{}l}
b \\ c
\end{tabular}
\\
\hline
d & e
\end{tabular}
\begin{tabular}[t]{ll}
a &
\begin{tabular}[t]{@{}l}
b \\ c
\end{tabular}
\\[5pt]
\hline
d & e
\end{tabular}
\end{document}
\\\noalign{\vspace{1cm}}
will do what you want (that is more or less what the booktabs command is doing), if you do have vertical rules and want to add space without breaking them., it's harder.\addlinespace
) and yours (with\noalign
) break vertical lines. My first solution (void row) doesn't, even if clumsy.