# [Tex/LaTex] Figure and table side-by-side in subfloats

floatssubfloatsvertical alignment

A very similar question has been asked before:

Table and Figure side-by-side with independent captions

I'm trying to accomplish this, but while using the subfig package. The image below depicts almost what I want, but as you can see, the table is not aligned correctly:

The TeX I'm working with is:

\begin{figure}[h]
\caption{A figure and a table, side-by-side}
\centering
\subfloat[A figure left of a table]{
\rule{6.4cm}{3.6cm}
}
\subfloat[A table right of a figure]{
\begin{tabular}{cc}\hline
Table head & Table head \\ \hline
Some values & Some values \\
Some values & Some values \\
Some values & Some values \\
Some values & Some values \\
Some values & Some values \\
Some values & Some values \\ \hline
\end{tabular}
}
\end{figure}


I've tried throwing a few minipages into the mix, but to no avail. How can I align the top of the table to the top of the figure?

#### Best Answer

The caption package version you use is too old to work fine with the actual version of hyperref.

That's explaining both issues, the wired behaviour when used with the subfig package, and the error you get when using the subcaption package. So updating the caption package (or even better: your whole TeX system) should help.

(Current versions of the hyperref package need at least caption v3.1m from 2010/01/09)

Addendum: The very next version 1.1b of the subcaption package will typeout a more reasonable error message.