I want to add vertical space between \hline
's and the rows consisting of only \multicolumn
. I do not want to use \midrule
.
The answers in this question do not work in case of \multicolumn
.
Here is MWE:
\documentclass{article}
\begin{document}
\begin{tabular}{ll}
\hline
\multicolumn{2}{c}{Method A}\\
\hline
1) & $\begin{array}{c}a\leftarrow A^Tb \\ c\leftarrow A^Td_Z \end{array}$\\
\hline
\multicolumn{2}{c}{Method B}\\
\hline
2) & $\begin{array}{c}a\leftarrow A^Tb \\ c\leftarrow A^Td_Z \end{array}$\\
\hline
\end{tabular}
\end{document}
Best Answer
The
cellspace
package lets you define independent minimal spacings at the top and the bottom of a cell. All you have to do then is prefixing the column to which you want to apply these minimal spacings with the letterS
. This conflicts with theS
qualifier from thesiunitx
package, which replaces it with theC
prefix. It works with usual column types (l, r, c, p, m, X) – you can add column types – but not with S. See the documentation for more details.