[Tex/LaTex] Default value for \addlinespace from booktabs

booktabstables

In the booktabs package documentation the command is described in the following:

Occasionally we want to put an extra space between certain rows of a table; for
example, before the last row, if this is a total. This is simply a matter of inserting
\addlinespace[width] after the \\ alignment marker.

Further the documentation says:

The default space before or after an adjacent rule is replaced by exactly \defaultaddspace or the amount of space specified in the optional argument.

I, however, do not know how to use this command, for instance

\defaultaddspace{10pt}

before or inside the tabular environment results in \defaultaddspace{10pt}

Missing number, treated as zero.

Followup:

\addlinespace works now, however, I cannot get the desired result:

\begin{tabular}{|c|p{0.66\textwidth}|}
\hline
\textbf{Title} & \textbf{A}\\
\addlinespace
Row & B\\
\hline
\end{tabular}

The borders are broken when I insert \addlinespace. The space is added, but in this extra space there are no lined borders on the left and on the right.

Best Answer

use it this way:

\documentclass{article}
\usepackage{array,booktabs}

\newcommand\myVSpace[1][10pt]{\rule[\normalbaselineskip]{0pt}{#1}}

\begin{document}

\begin{tabular}{|c|p{0.66\textwidth}|}\hline
\myVSpace\textbf{Title} & \textbf{A}\\[\defaultaddspace]
Row & B\\\hline
\myVSpace[20pt]Row & B\\\hline
\end{tabular}

\end{document}

or do not use booktabs and then \\[10pt] instead. enter image description here

The image shows how the optional argument of \rule works. I used \rule[...]{10pt}{#1} to make the box visible

Related Question