Graphics, Figures & TablesVertical Alignment of Tables

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Arxas
Posts: 4
Joined: Fri Oct 22, 2010 9:22 pm

Vertical Alignment of Tables

Post by Arxas »

Hello, I am having a problem with tables vertical alignment. I am trying to put two tables next to each other. The problem is one of them is bigger and I have no idea how to align the smaller one at the top, not in the middle - I want them both to start at same height.

Code: Select all

\begin{table}[!ht]
    \begin{tabular}{|c|c|}
         bigger table
    \end{tabular}
    \begin{tabular}{|c|c|}
         smaller table
    \end{tabular}
\end{table}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Vertical Alignment of Tables

Post by localghost »

The tabular environment accepts an optional parameter for vertical alignment with respect to the current line.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}

\begin{document}
  \begin{table}[!ht]
    \begin{tabular}[t]{|c|c|}
      Table Head & Table Head \\
      Some Values & Some Values \\
      Some Values & Some Values \\
      Some Values & Some Values \\
      Some Values & Some Values \\
      Some Values & Some Values \\
      Some Values & Some Values
    \end{tabular}
    \hspace{1em}
    \begin{tabular}[t]{|c|c|}
      Table Head & Table Head \\
      Some Values & Some Values \\
      Some Values & Some Values \\
      Some Values & Some Values
    \end{tabular}
  \end{table}
\end{document}

Thorsten
Arxas
Posts: 4
Joined: Fri Oct 22, 2010 9:22 pm

Re: Vertical Alignment of Tables

Post by Arxas »

Works perfectly, thank you very much.
Post Reply