# How can I get two environments at the same height?

So I've got a page.

--------------------
|                  |
|                  |
|                  |
|                  |


I've got two environments, like \begin{tabular}...\end{tabular}, and I want one left aligned and the other right aligned, but at the same height. Like floated left and floated right like this:

--------------------
|_____        _____|
||    |      |    ||
||  A |      |  B ||
|------      ------|


Where A and B here are my environments.

• <env1> \hfill <env2>? Use the optional argument to the tabular environment to set the vertical alignment between the two tabulars. – Paul Gessler Aug 13 '16 at 4:11
• That works. Thx – Forwarding Aug 13 '16 at 4:17
• @PaulGessler: Please transform your comment into an answer (or shall we close it as duplicate of question X?) – user31729 Aug 13 '16 at 9:28

Use \hfill between the environments to distribute them across the available horizontal space. If the two tabulars have different numbers of rows, you might want to use the optional argument to achieve the desired vertical alignment.

In the first example, the tabular material does not reach the typeblock edge exactly: this is caused by the default (6 pt) space inserted on either side of all tabular columns.

In the second example, the material is pushed completely to the typeblock edges by using @{} to insert no space on the outer edges rather than the default \tabcolsep.

\documentclass{article}

\begin{document}

\noindent X\hrulefill X

\begin{table}[h]
\begin{tabular}{c}
Test Tabular \\ A
\end{tabular}%
\hfill%
\begin{tabular}{c}
Test Tabular\\ B
\end{tabular}
\end{table}

\noindent X\hrulefill X

\begin{table}[h]
\begin{tabular}{@{}c}
Test Tabular \\ A
\end{tabular}%
\hfill%
\begin{tabular}{c@{}}
Test Tabular\\ B
\end{tabular}
\end{table}

\end{document}