6

In the table created in the MWE below, I want the space between the crule and the third row to be slightly greater and the space between the text in the 2nd row and the crule to be slightly smaller. How can I do that?

\documentclass{article} 
\usepackage{booktabs}
\usepackage{multirow}

\begin{document}

\renewcommand{\arraystretch}{1.2}

\begin{table}[tp]
\caption{Minimum Working Example}
\centering
\begin{tabular}{cccc}
\toprule
 & & \multicolumn{2}{c}{First Dimension} \\
 & & 1st D Value 1  & 1st D Value 2      \\ \cline{3-4} 
 \multirow{2}*{Second dimension} & 2nd D Value1 & Outcome(1,1)  & Outcome(1,2) \\
 & 2nd D Value2 & Outcome(2,1) & Outcome(2,2)       \\
\bottomrule
\end{tabular}
\end{table}
\end{document}

enter image description here

  • There is no \crule, you mean \cline or \cmidrule? – user31729 Mar 11 '18 at 14:14
  • @ChristianHupfer There is \cline in the MWE – CarLaTeX Mar 11 '18 at 14:16
  • 1
    @CarLaTeX: Yes, but the OP asks for \crule ;-) – user31729 Mar 11 '18 at 14:17
  • 2
    @ChristianHupfer Yes, I think it's a lapsus :) – CarLaTeX Mar 11 '18 at 14:18
  • 1
    @CarLaTeX: We never cause a lapsus, do we? ;-) – user31729 Mar 11 '18 at 14:34
5

There is no \crule macro in booktabs, but \cmidrule, having the same meaning as \cline, but providing more space.

If the regular spacing (controlled by \aboverulesep and \bottomrulesep) is not sufficient, an explicit \addlinespace can be injected:

\documentclass{article} 
\usepackage{booktabs}
\usepackage{multirow}


\newlength{\ridiculouslylargecmidrulesep}
\setlength{\ridiculouslylargecmidrulesep}{50pt}

\begin{document}

\renewcommand{\arraystretch}{1.2}

\begin{table}[tp]
\caption{Minimum Working Example}
\centering
\begin{tabular}{cccc}
\toprule
 & & \multicolumn{2}{c}{First Dimension} \\
 & & 1st D Value 1  & 1st D Value 2      \\ \cmidrule{3-4} 
 \multirow{2}*{Second dimension} & 2nd D Value1 & Outcome(1,1)  & Outcome(1,2) \\
 & 2nd D Value2 & Outcome(2,1) & Outcome(2,2)       \\
\bottomrule
\end{tabular}
\end{table}


\begin{table}[tp]
\caption{Minimum Working Example}
\centering
\begin{tabular}{cccc}
\toprule
 & & \multicolumn{2}{c}{First Dimension} \\
 & & 1st D Value 1  & 1st D Value 2      \\ \addlinespace[\ridiculouslylargecmidrulesep]
\cmidrule{3-4}  \addlinespace[\ridiculouslylargecmidrulesep]
 \multirow{2}*{Second dimension} & 2nd D Value1 & Outcome(1,1)  & Outcome(1,2) \\ 
 & 2nd D Value2 & Outcome(2,1) & Outcome(2,2)       \\
\bottomrule
\end{tabular}
\end{table}

\end{document}

enter image description here

5

I think that your table may be the rare case that looks better if one employs \hline and \cline, along with suitably placed vertical lines, than if one uses the line-drawing macros of the booktabs package.

enter image description here

\documentclass{article}
\usepackage{multirow}
\usepackage[skip=0.333\baselineskip]{caption}

\begin{document}

\begin{table}[ht!]
\renewcommand{\arraystretch}{1.6}

\caption{Minimum Working Example}
\centering
\begin{tabular}{|*{4}{c|}}
\cline{3-4}
\multicolumn{2}{c|}{} & \multicolumn{2}{c|}{First Dimension} \\
\cline{3-4}
\multicolumn{2}{c|}{} & 1st D Value 1  & 1st D Value 2  \\ 
\hline
\multirow{2}{*}{Second dimension} & 2nd D Value1 & Outcome(1,1)  & Outcome(1,2) \\
\cline{2-4}
 & 2nd D Value2 & Outcome(2,1) & Outcome(2,2)       \\
\hline
\end{tabular}
\end{table}

\end{document}
  • 2
    The wrath of a certain Italian mathematician will come over you, for your vertical line blasphemy ;-) – user31729 Mar 11 '18 at 14:45
  • 2
    @ChristianHupfer - I'll keep my fingers crossed that this certain Italian mathematician is aware of the following paraphrase of a well-known proverb: "There is no \crule without an exception". (Groan. Ouch!) – Mico Mar 11 '18 at 14:51
  • 1
    @Mico: Thanks, this is great—much appreciated. – Peter Mar 11 '18 at 19:23

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.