2

I have two tables side by side. I want to trick readers into seeing this as one table, by widening the toprule command.

In the MWE below I want to join the toprule of the cats table to the dogs table, and the same for the bottom rule and mid rules.

Imgur

This is a sneaky way of entering table data by order of column, rather than by rows.

The MWE is

\documentclass[10pt]{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}[t]{l}\toprule
cat\\
cat\\
cat\\
cat\\
cat\\
cat\\\bottomrule
\end{tabular}
\begin{tabular}[t]{l}\toprule
dog\\
dog\\
dog\\
dog\\
dog\\
dog\\\bottomrule
\end{tabular}
\end{document}
Tim
  • 1,539

2 Answers2

3

This is very simple to achieve ... just ad % between tables to prevent space between them:

enter image description here

\documentclass[10pt]{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}[t]{l}\toprule
cat\\
cat\\
cat\\
cat\\
cat\\
cat\\\bottomrule
\end{tabular}%
\begin{tabular}[t]{l}\toprule
dog\\
dog\\
dog\\
dog\\
dog\\
dog\\\bottomrule
\end{tabular}
\end{document}
Zarko
  • 296,517
  • yes perfect. I still don't understand the rules of %.......my bad. – Tim Nov 29 '15 at 17:16
  • 1
    The % make that \end{tabular} is continued without any spaces with begin{tabular} in the next editor line. The same result you obtain if you write ...\end{tabular}\begin{tabular} .... – Zarko Nov 29 '15 at 17:21
1

You can simply wrap the tabulars inside a tabular. For example:

\documentclass[10pt]{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{@{}c@{}c@{}}\toprule
  \begin{tabular}[t]{l}
    cat\\
    cat\\
    cat\\
    cat\\
    cat\\
    cat\\
  \end{tabular}
  &
  \begin{tabular}[t]{l}
    dog\\
    dog\\
    dog\\
    dog\\
    dog\\
    dog\\
  \end{tabular}\\
  \bottomrule
\end{tabular}
\end{document}

nested tables

cfr
  • 198,882