Graphics, Figures & TablesTwo Tables Side by Side with individual Labels

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Hugosar
Posts: 3
Joined: Tue Nov 22, 2011 9:18 pm

Two Tables Side by Side with individual Labels

Post by Hugosar »

Hi everyone!

Does anyone know how to put two tables side by side but with individual labels that will work with hyperref?

Thank you so much!
Hugo Sardinha

Recommended reading 2024:

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

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

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

Two Tables Side by Side with individual Labels

Post by localghost »

Since version 3.2 the caption package offers a (yet undocumented) feature for this purpose.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[tableposition=top]{caption}

\begin{document}
  \begin{table}[!htb]
    \captionbox{First table}{%
      Code for table
    }
    \captionbox{Second table}{%
      Code for table
    }
  \end{table}
\end{document}
The syntax is very similar to that of the \subcaptionbox command from the subcaption package (which is shipped with caption), which is documented in its manual.

There would be an alternative solution with two {minipage} environments which each contain a {tabular} environment embedded into the same {table} environment.


Thorsten
Post Reply