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 have a table that is to big to fit in the page width, thus it is separated into two tables. The truth is that I only use one table but insert an empty row in the middle so that the columns stay aligned. Here's a reduced size example:

enter image description here

The idea is to removed the double line from the last column in the first row, and the vertical line that separates the last column from the empty column in the second table. The lines are the ones inside the green ellipsis.

The code for the image is:

\begin{table}[t]
\centering
\begin{tabular}{c | c | r | r | r | r | r}
\multicolumn{2}{}{} & \multicolumn{3}{|c}{NS} & \multicolumn{2}{|c}{PV} 
\\
Game Phase & Depth & \multicolumn{1}{|c}{TNC} & \multicolumn{1}{|c}{\# Cutoffs} & \multicolumn{1}{|c}{\# Re-searches} & \multicolumn{1}{|c}{TNC} & \multicolumn{1}{|c}{Gain}
\\\hline\hline
\multirow{2}{*}{Opening} & 8 & 336 & 10 568 & 1 231 & 336 & 0.00
\\
& 12 & 6 871 & 246 028 & 5 520 & 6 871 & 0.00
\\\hline
\multirow{2}{*}{Middle Game} & 8 & 1 605 & 71 728 & 5 532 & 1 605 & 0.00
\\
& 12 & 43 167 & 2 811 969 & 30 219 & 43 167 & 0.00
\\
\multicolumn{7}{}{}
\\
\multicolumn{2}{}{} & \multicolumn{4}{|c}{Two Bounds}
\\
Game Phase & Depth & \multicolumn{1}{|c}{TNC} & \multicolumn{1}{|c}{\# Cutoffs} & \multicolumn{1}{|c}{\# Re-searches} & \multicolumn{1}{|c}{Gain}
\\\hline\hline
\multirow{2}{*}{Opening} & 8 & 334 & 10 436 & 1 232 & 0.58
\\
& 12 & 6 844 & 244 147 & 5 524 & 0.39
\\\cline{1-6}
\multirow{2}{*}{Middle Game} & 8 & 1 599 & 71 490 & 5 519 & 0.38
\\
& 12 & 42 957 & 2 796 029 & 30 011 & 0.48
\end{tabular}
\caption{example}
\label{tab:example}
\end{table}
share|improve this question
2  
Also see how to make double cline in tables which references the booktabs package that has some useful guidelines for tables. –  Peter Grill Sep 30 '11 at 16:21
add comment

3 Answers

A better way of doing the table is, of course, with booktabs and siunitx:

\usepackage{siunitx,booktabs}
...
\begin{table}
\newcommand\?{\multicolumn{1}{S[table-format=2.0]}} % just a shortcut
\centering
\begin{tabular}{c c *{4}{S[table-format=7.0,group-minimum-digits=4]}
  S[table-format=1.2]}
\toprule
&& \multicolumn{3}{c}{NS} & \multicolumn{2}{c}{PV} \\
\cmidrule(lr){3-5} \cmidrule(lr){6-7}
Game Phase & Depth & \multicolumn{1}{c}{TNC} & \multicolumn{1}{c}{\# Cutoffs} & 
  \multicolumn{1}{c}{\# Re-searches} & \multicolumn{1}{c}{TNC} & \multicolumn{1}{c}{Gain} \\
\midrule
Opening & 8 & 336 & 10 568 & 1 231 & 336 & 0.00 \\
        & 12 & 6 871 & 246 028 & 5 520 & 6 871 & 0.00 \\
\midrule
Middle Game & 8 & 1 605 & 71 728 & 5 532 & 1 605 & 0.00 \\
            & 12 & 43 167 & 2 811 969 & 30 219 & 43 167 & 0.00 \\
\bottomrule
\addlinespace[2ex]
\toprule
&& \multicolumn{4}{c}{Two Bounds} \\
\cmidrule(lr){3-6}
Game Phase & Depth & \multicolumn{1}{c}{TNC} & \multicolumn{1}{c}{\# Cutoffs} &
  \multicolumn{1}{c}{\# Re-searches} & \multicolumn{1}{c}{\hidewidth Gain\hidewidth}\\
\midrule
Opening & 8 & 334 & 10 436 & 1 232 & \?{0.58} \\
        & 12 & 6 844 & 244 147 & 5 524 & \?{0.39} \\
\midrule
Middle Game & 8 & 1 599 & 71 490 & 5 519 & \?{0.38} \\
            & 12 & 42 957 & 2 796 029 & 30 011 & \?{0.48} \\
\bottomrule
\end{tabular}
\caption{An example}
\end{table}

enter image description here

share|improve this answer
    
I love the use of the booktabs package, but I'd (i) get rid of the \bottomrule and \toprule in the middle of the tableau, (ii) replace the \midrule commands in the second half of the tableau with \cmidrule[\lightrulewidth]{1-6} and (iii) replace the final \bottomrule command with \cmidrule[\heavyrulewidth]{1-6}. Items (ii) and (iii) are designed to meet the OP's request (green ellipse) -- at least that's how I understood it. –  Mico Sep 30 '11 at 16:58
    
@Mico I feel that the two rules in the middle help to understand that the table is actually split into two; without them one is led to continue down the columns. I usually say that rules are barriers to stop reading (and that's why vertical rules should not be used). About the \cmidrule to cut the last column, it's just a matter of taste. –  egreg Sep 30 '11 at 17:03
add comment

Another way is this:

\begin{table}[t]
\centering
\begin{tabular}{c | c | r | r | r | r | r}
\multicolumn{2}{}{} & \multicolumn{3}{|c}{NS} & \multicolumn{2}{|c}{PV}
\\
Game Phase & Depth & \multicolumn{1}{|c}{TNC} & \multicolumn{1}{|c}{\# Cutoffs} & \multicolumn{1}{|c}{\# Re-searches} & \multicolumn{1}{|c}{TNC} & \multicolumn{1}{|c}{Gain}
\\\hline\hline
\multirow{2}{*}{Opening} & 8 & 336 & 10 568 & 1 231 & 336 & 0.00
\\
& 12 & 6 871 & 246 028 & 5 520 & 6 871 & 0.00
\\\hline
\multirow{2}{*}{Middle Game} & 8 & 1 605 & 71 728 & 5 532 & 1 605 & 0.00
\\
& 12 & 43 167 & 2 811 969 & 30 219 & 43 167 & 0.00
\\
\multicolumn{7}{}{}
\\
\multicolumn{2}{}{} & \multicolumn{4}{|c}{Two Bounds}
\\
Game Phase & Depth & \multicolumn{1}{|c}{TNC} & \multicolumn{1}{|c}{\# Cutoffs} & \multicolumn{1}{|c}{\# Re-searches} & \multicolumn{2}{|c}{Gain}
\\\hline\hline
\multirow{2}{*}{Opening} & 8 & 334 & 10 436 & 1 232 & \multicolumn{2}{|c}{0.58}
\\
& 12 & 6 844 & 244 147 & 5 524 & \multicolumn{2}{|c}{0.39}
\\\cline{1-7}
\multirow{2}{*}{Middle Game} & 8 & 1 599 & 71 490 & 5 519 & \multicolumn{2}{|c}{0.38}
\\
& 12 & 42 957 & 2 796 029 & 30 011 & \multicolumn{2}{|c}{0.48}
\end{tabular}
\caption{example}
\label{tab:example}
\end{table}

The difference here is that the last column in the second table will have the same span as the last two columns from the first table.

enter image description here

share|improve this answer
add comment

You should use \hhline{<hline spec>} from the hhline package. It allows for a very broad range (and better control) of horizontal lines in array and tabular environments through <hline spec>. It controls whether to put a double/single horizontal line, and whether vertical lines should be cut/not across horizontal double lines. In your case, I used = for double lines and : to cut vertical lines across =. Using hhline is necessary, since multiple \clines overprint into a single \cline by default:

\documentclass{article}
\usepackage{multirow}% http://ctan.org/pkg/multirow
\usepackage{hhline}% http://ctan.org/pkg/hhline
\begin{document}
\begin{table}[t]
\centering
\begin{tabular}{c | c | r | r | r | r | r}
\multicolumn{2}{}{} & \multicolumn{3}{|c}{NS} & \multicolumn{2}{|c}{PV} 
\\
Game Phase & Depth & \multicolumn{1}{|c}{TNC} & \multicolumn{1}{|c}{\# Cutoffs} & \multicolumn{1}{|c}{\# Re-searches} & \multicolumn{1}{|c}{TNC} & \multicolumn{1}{|c}{Gain}
\\\hhline{=:=:=:=:=:=:=}
\multirow{2}{*}{Opening} & 8 & 336 & 10 568 & 1 231 & 336 & 0.00
\\
& 12 & 6 871 & 246 028 & 5 520 & 6 871 & 0.00
\\\hline
\multirow{2}{*}{Middle Game} & 8 & 1 605 & 71 728 & 5 532 & 1 605 & 0.00
\\
& 12 & 43 167 & 2 811 969 & 30 219 & 43 167 & 0.00
\\
\multicolumn{7}{}{}
\\
\multicolumn{2}{}{} & \multicolumn{4}{|c}{Two Bounds}
\\
Game Phase & Depth & \multicolumn{1}{|c}{TNC} & \multicolumn{1}{|c}{\# Cutoffs} & \multicolumn{1}{|c}{\# Re-searches} & \multicolumn{1}{|c}{Gain}
\\\hhline{=:=:=:=:=:=~}
\multirow{2}{*}{Opening} & 8 & 334 & 10 436 & 1 232 & \multicolumn{1}{|c}{0.58}
\\
& 12 & 6 844 & 244 147 & 5 524 & \multicolumn{1}{|c}{0.39}
\\\cline{1-6}
\multirow{2}{*}{Middle Game} & 8 & 1 599 & 71 490 & 5 519 & \multicolumn{1}{|c}{0.38}
\\
& 12 & 42 957 & 2 796 029 & 30 011 & \multicolumn{1}{|c}{0.48}
\end{tabular}
\caption{example}
\label{tab:example}
\end{table}
\end{document}

Table broken into two with different columns

Another option might be to turn the table sideways to have more space to put it on a portrait page layout. However, that is a personal preference.

share|improve this answer
add comment

Your Answer

 
discard

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