1

I have the following table, used with booktabs. I call it "symmetric" as three states of two variables are compared, but it does not matter if a variable is written along the rows or along the columns. It is not a some variables (columns) describing observations (rows), but two variables and their correlation. I may also invert "X → Y" and "Y → X", it would be the same).

In this situation, using booktabs and its strict guidelines (especially “never, ever use vertical rules”) does not really make sense. Why is there a line below "X → Y" variable labels and not at right of "Y → X" variable labels?

What is the recommended way of displaying such a table? Should I use booktabs at all in this specific situation?

\documentclass{article}
\usepackage{booktabs}

\begin{document}
\begin{table}
  \centering
  \caption{Quality of links, one way versus the other}
  \begin{tabular}{llccc}
    \toprule
    & & \multicolumn{3}{c}{$X \rightarrow Y$} \\
    \cmidrule{3-5}
    & & good & uncertain & weak \\
    \midrule
    & good & 32 & 12 & 2 \\
    $Y \rightarrow X$
    & uncertain & 13 & 52 & 5 \\
    & weak & 4 & 2 & 3 \\
    \bottomrule
  \end{tabular}
\end{table}
\end{document}

enter image description here

Zarko
  • 296,517
audeoudh
  • 278
  • 2
  • 12
  • 2
    Well, your table structure is symmetric logically [or perhaps mathematically ?...though the values does not depict a symmetric matrix where, say, (good, weak) is 2, but (weak, good) is 4 !] The booktabs guidelines are for visual comfort and professional look. You can see any scientific journal article, where vertical lines are never used. They impair reading flow. To summarize: your table looks perfect. – Partha D. Sep 18 '19 at 14:19
  • @ParthaD. Yep, I understand why booktabs provides these guideline. The question is, does they really applies here? Doesn't they break signification (and readability) of the table, with "X→Y"'s labels separated from the data while "Y→X"' labels aren't? — Don't worry about mathematical symmetry, the table effectively does not really have mathematical sense, because of details missing in the example. – audeoudh Sep 20 '19 at 09:14

2 Answers2

3

There can be some minor improvements (from my point of view): trimming the \cmidrule, a slightly larger spacing between the last 3 rows, and a larger spacing between caption and table:

\documentclass{article}
\usepackage{booktabs, caption}
\captionsetup{skip =4pt}

\begin{document}

\begin{table}
  \centering
  \caption{Quality of links, one way versus the other}
  \begin{tabular}{llccc}
    \toprule
    & & \multicolumn{3}{c}{$X \rightarrow Y$} \\
    \cmidrule(lr){3-5}
    & & good & uncertain & weak \\
    \midrule
    & good & 32 & 12 & 2 \\[2pt]
    $Y \rightarrow X$
    & uncertain & 13 & 52 & 5 \\[2pt]
    & weak & 4 & 2 & 3 \\
    \bottomrule
  \end{tabular}
\end{table}

\end{document} 

enter image description here

Bernard
  • 271,350
0

Well…

  • Either you and don't worry of the semantic equivalence between "X→Y" and "Y→X", and you are just presenting a table. Then booktabs rules are OK, your code is OK, and Bernard's design is cool.

  • Or you absolutely want to separate your numbers from the labels and be "symmetric" (i.e. do the same formatting between "X→Y" and "Y→X"), and you accept breaking the booktabs rules; then put two tiny vertical rule (cmidrule's equivalent) between the 1st, 2nd and 3rd columns.

  • Or, just do not put any rule in the table, just keep the toprule and the bottomrule (they are not annoying). You may need to put a little more space between column labels and following lines, as shown there.

    \documentclass{article}
    \usepackage{booktabs}
    \usepackage{caption}
      \captionsetup{skip=4pt}
    
    \begin{document}
    \begin{table}
      \centering
      \caption{Quality of links, one way versus the other}
      \begin{tabular}{llccc}
        \toprule
        & & \multicolumn{3}{c}{$X \rightarrow Y$} \\
        %\cmidrule(lr){3-5}
        & & good & uncertain & weak \\
        %\midrule
        \addlinespace
        & good & 32 & 12 & 2 \\
        $Y \rightarrow X$
        & uncertain & 13 & 52 & 5 \\
        & weak & 4 & 2 & 3 \\
        \bottomrule
      \end{tabular}
    \end{table}
    \end{document}
    

    example of table

audeoudh
  • 278
  • 2
  • 12