# Table and figure side-by-side with independent captions

Looking to put a table and a figure side by side so that the table and figure have their own captions. A crude sketch

------------              -----------------
TABLE
| a |  b |                     FIGURE
| c |  d |
------------
Table 2: Caption           -----------------
Figure 7: Caption

The closest I've gotten is:

\begin{table}%
\centering
\parbox{0.4\textwidth}{
\begin{footnotesize}
\begin{tabular}{| l | r |} \hline
some & table\\
\end{tabular}
\end{footnotesize}
\caption{Table}
\label{tab:table}
}
\qquad
\begin{minipage}[c]{0.53\textwidth}%
\centering
\includegraphics[width=1\textwidth]{awesome}
\caption{Figure}
\label{fig:figure}
\end{minipage}
\end{table}

But that gives two Table X: Caption captions. I didn't find anything in subfig.

Help?

-
– badroit Mar 11 '13 at 19:22

## 2 Answers

Use a floatrow environment of the package of the same name.

\documentclass{article}

\usepackage{floatrow}
% Table float box with bottom caption, box width adjusted to content
\newfloatcommand{capbtabbox}{table}[][\FBwidth]

\usepackage{blindtext}

\begin{document}

\blindtext

\begin{figure}
\begin{floatrow}
\ffigbox{%
\rule{3cm}{3cm}%
}{%
\caption{A figure}%
}
\capbtabbox{%
\begin{tabular}{cc} \hline
Author & Title \\ \hline
Knuth & The \TeX book \      Lamport & \LaTeX \\ \hline
\end{tabular}
}{%
\caption{A table}%
}
\end{floatrow}
\end{figure}

\end{document}

-
Many thanks. Worked perfectly: floated, correct labelling, separate captions, and even handled the footnote in my table correctly! – badroit Dec 10 '10 at 18:01
@alex: In my example, replace \rule{3cm}{3cm} with \includegraphics{<whatever>}. – lockstep Nov 13 '11 at 16:55
It was a joke, I swear! It was a joke! And I didn't remember I answered one of your questions! ... But this is a nice surprise. :-) – lockstep Jan 9 '12 at 21:41
...are you saying my questions aren't memorable? :P Anyways, don't spend it all in one shop. – badroit Jan 11 '12 at 3:25
I get the error: Package floatrow Error: Do not use float package with floatrow. will floatrow replace float? or is there another workaround ? – Fry Feb 6 '14 at 21:18

You can use the »caption« package. See code below for an example derived from the package manual.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}

\DeclareCaptionLabelFormat{andtable}{#1~#2  \&  \tablename~\thetable}

\begin{document}
\begin{figure}[!ht]
\centering
\rule{6.4cm}{3.6cm}
\qquad
\begin{tabular}[b]{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}
\captionlistentry[table]{A table beside a figure}
\captionsetup{labelformat=andtable}
\caption{A table beside a figure}
\end{figure}
\end{document}

You will find more details in the manual. This is not exactly what you want, but it would float.

Supplement:

Another solution that would give the desired output. But this won't float.

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont=bf]{caption}

\begin{document}
\begin{minipage}{\textwidth}
\begin{minipage}[b]{0.49\textwidth}
\centering
\rule{6.4cm}{3.6cm}
\captionof{figure}{A table beside a figure}
\end{minipage}
\hfill
\begin{minipage}[b]{0.49\textwidth}
\centering
\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}
\captionof{table}{A table beside a figure}
\end{minipage}
\end{minipage}
\end{document}

-
Thorsten, many thanks for the detailed answer and excellent examples. I went with the other answer since it's essentially a floating version of your second example where I can have separate captions. – badroit Dec 10 '10 at 18:03
why does this no longer work if you try to put the captions above the figure and table? – emily Jul 8 '12 at 16:35

## protected by Torbjørn T.Jul 2 at 20:13

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?