6

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

5

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}
  • 1
    +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
3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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