1

I want to put two tables side by side. Each table has its own caption and the two have a common caption. I can do that with subfloat:

\begin{table}
\centering
\subfloat[][left]{\begin{tabular}{|c|}\hline...\hline\end{tabular}}
\quad
\subfloat[][right]{\begin{tabular}{|c|}\hline...\hline\end{tabular}}
\caption{common}
\end{table}

However, I want something more: The left table has 10 rows The right table has 9 rows.

I want the right table to have the same height as the left table and its row spacing adjusted.

I'll be happy with either of these:

  1. the first row of the right table is at the same position as the first row of the left table, its last row is at the same position as the last row of the left table, and other rows are evenly spaced.
  2. The rows of the right table are evenly spaced between the top and bottom of the table.

I should point out that my actual problem is little more complex. I'm dealing with three side by side tables. I'm hoping the answer can be generalized.

1

The problem can be resolved by using

\renewcommand\arraystretch{value}

in the columns with lesser rows. The value is set to the row ratio, in this case 10/9 = 1.111 (theoretically). A small increase may be required above the theoretical value of 10/9 to account for the fact that there are 11 \hlines in the one column, and only 10 in the second.

EDITED to show generalization to three columns, with 10, 9, and 4 rows. Theoretically, the \arraystrectch values should be 1, 10/9, and 10/4. In actual use here, I employ 1, 1.115, and 2.55.

\documentclass{article}
\usepackage{subfig}
\begin{document}

\begin{table}
\centering
\subfloat[][left]{\begin{tabular}{|c|}
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
\end{tabular}}
\quad
\subfloat[][right]{\renewcommand\arraystretch{1.115}%
\begin{tabular}{|c|}
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline\end{tabular}}
\quad
\subfloat[][right]{\renewcommand\arraystretch{2.55}%
\begin{tabular}{|c|}
\hline
...\\
\hline
...\\
\hline
...\\
\hline
...\\
\hline\end{tabular}}
\caption{common}
\end{table}

\end{document}

enter image description here

2
  • ohh you just beat me to it (+1:-) – David Carlisle Oct 25 '14 at 20:37
  • @DavidCarlisle Oh, believe me, I know what you mean 8^o Been there, done that. – Steven B. Segletes Oct 25 '14 at 20:50

Your Answer

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