Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to put spaces between rows in a table however my current implementation cuts off the vertical lines. I know I can replace \\with {} \ {} \ {} ..., but is there a more elegant solution?

\begin{table}
\begin{tabular}{l | c c c c | c c c c}
\multicolumn{1}{c}{} & \multicolumn{4}{c}{Initial Conditions} & \multicolumn{4}{c}{Final Conditions} \\
Scenario No. & Latitude & Longitude & Altitude & Airspeed & Latitude & Longitude & Altitude & Airspeed \\ \hline
1-01 & 44.251100 & -75.760474 & 5000 & 75 & 45.095869 & -75.773706 & 1580 & 75 \\
1-02 & 44.251100 & -75.760474 & 5000 & 75 & 45.998808 & -75.744519 & 1580 & 75 \\ 
\\
1-03 & 44.222150 & -75.395867 & 5000 & 75 & 45.095869 & -75.773706 & 1580 & 75 \\
1-04 & 44.222150 & -75.395867 & 5000 & 75 & 45.998808 & -75.744519 & 1580 & 75 \\
\\
1-05 & 44.084742 & -75.893425 & 5000 & 75 & 45.095869 & -75.773706 & 1580 & 75 \\
1-06 & 44.084742 & -75.893425 & 5000 & 75 & 45.998808 & -75.744519 & 1580 & 75 \\
\bottomrule
\end{tabular}
\end{table}

enter image description here

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

You can use the optional argument of \\ to increase the vertical space between rows and keeping the table format:

\documentclass{book}
\usepackage{booktabs}

\begin{document}

\begin{table}
  \begin{tabular}{l | c c c c | c c c c}
    \multicolumn{1}{c}{} & \multicolumn{4}{c}{Initial Conditions} 
      & \multicolumn{4}{c}{Final Conditions} \\
    Scenario No. & Latitude & Longitude & Altitude & Airspeed & Latitude & Longitude & Altitude 
      & Airspeed \\ \hline
    1-01 & 44.251100 & -75.760474 & 5000 & 75 & 45.095869 & -75.773706 & 1580 & 75 \\
    1-02 & 44.251100 & -75.760474 & 5000 & 75 & 45.998808 & -75.744519 & 1580 & 75 \\[1em]
    1-03 & 44.222150 & -75.395867 & 5000 & 75 & 45.095869 & -75.773706 & 1580 & 75 \\
    1-04 & 44.222150 & -75.395867 & 5000 & 75 & 45.998808 & -75.744519 & 1580 & 75 \\[1em]
    1-05 & 44.084742 & -75.893425 & 5000 & 75 & 45.095869 & -75.773706 & 1580 & 75 \\
    1-06 & 44.084742 & -75.893425 & 5000 & 75 & 45.998808 & -75.744519 & 1580 & 75 \\
\bottomrule
\end{tabular}
\end{table}

\end{document}
share|improve this answer
    
+1 I had this as alternative in the first version of my answer but removed it because it didn't work with \baselineskip. Thing is: \baselineskip is set to 0pt inside the tabular! :-D –  Martin Scharrer Apr 12 '11 at 17:12
    
+1 Simple and elegant solution, exactly what I was look for! –  Elpezmuerto Apr 12 '11 at 17:13
add comment

The vertical lines are drawn as part of the cell. If you have only \\ and no & you do not create any cells except the very first one, and therefore you won't get vertical lines (or cell background colors).

To fix this you need to add the right number of & for the empty line, so replace \\ with &&&&&&&&\\. If you need this very often you can define it to a macro outside the tabular.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.