# Extra vertical space after \hline causes a gap in the right border of an array

I wanted to put a bit of space after an \hline in an array; the main suggestion floating round the Internet seems to be to use

\hline \\ [-1.5ex]


Unfortunately, this causes a gap in the line on the RHS of the array. A minimal example is:

\documentclass{article}
\begin{document}
\$\begin{array}{|l|l|}%
\hline
& TEXT\\
\end{document}


I've inserted a vertical strut of height 1.5\normalbaselineskip which is 18pt in the above example, any length exceeding the about 70% of the baseline skip would work. For more information on column and/row padding, see Column padding in tables.

Note that I've used amsmath to supply the \text command for setting text in math mode. Even though this is just a simple example and using \mbox would also suffice, amsmath also provides other functionality that is well worth using.

If you wish to insert a fixed amount (say) <len> between two rows, you can insert a blank row (with the appropriate number of column alignments & to provide correct vertical rule placement) and use a row skip of the form \$\dimexpr-\normalbaselineskip+<len>]. This would jump "back" a length of \normalbaselineskip - the baseline distance between rows - and jump "forward" by <len> - the required gap. Here's a small example: \documentclass{article} \usepackage{amsmath}% http://ctan.org/pkg/amsmath \begin{document} \[ \begin{array}[t]{|l|l|}% \hline & \text{Normal} \\ \hline & \text{Text} \\ \hline \end{array} \quad \begin{array}[t]{|l|l|}% \hline & \texttt{0pt} \\ \hline & \\[-\normalbaselineskip] & \text{Text} \\ \hline \end{array} \quad \begin{array}[t]{|l|l|}% \hline & \texttt{2pt} \\ \hline & \\[\dimexpr-\normalbaselineskip+2pt] & \text{Text} \\ \hline \end{array} \quad \begin{array}[t]{|l|l|}% \hline & \texttt{1em} \\ \hline & \\[\dimexpr-\normalbaselineskip+1em] & \text{Text} \\ \hline \end{array} \quad \begin{array}[t]{|l|l|}% \hline & \texttt{3pc} \\ \hline & \\[\dimexpr-\normalbaselineskip+3pc] & \text{Text} \\ \hline \end{array}$
\end{document}

-
Thanks! There is one difficulty with this approach, which is that I'm automatically generating my LaTeX code in a program. So I can't tune the height on a case-by-case basis. I will experiment with putting in a constant-height strut, but what I really want to do is put a fixed amount of space between the hline and whatever comes after it, regardless of the height of the latter. Maybe I can wrap whatever comes after the hline in some kind of vertical box, with a strut placed above it? It's a bit fiddly, but it would probably work... –  Mohan Jul 30 '12 at 23:28
@Mohan: I've updated my answer with a possibility that might work for you. Give some feedback if it doesn't. –  Werner Aug 1 '12 at 15:16
"with the appropriate number of column alignments & to provide correct vertical rule placement" --- ah! That's what I was missing. Thank you very much. (Output is now also satisfactory, though I used other means.) –  Mohan Aug 1 '12 at 17:22