# How do I float/wrap text around a table

I've been trying to use the wrapfigure and wraptable from the wrapfig package, but to no avail.

This works for text.

\begin{wrapfigure}{l}{40mm}
\begin{center}
Some random text
\end{center}
\end{wrapfigure}

This should be to the left of the table. \blindtext


But once I add a table (see code below), it fails.

\begin{wrapfigure}{l}{40mm}
\begin{center}
\begin{table}
\begin{tabular}{l | c}
A & Cell 1 \\ \hline
B & Cell 2 \\ \hline
\end{tabular}
\end{table} \\
Some random text
\end{center}
\end{wrapfigure}

This should be to the left of the table. \blindtext


What am I doing wrong?

Thanks.

-

The table environment is for normal floating tables. You do not need to put a tabular inside a table environment. You should use the wraptable environment instead.

\begin{wraptable}{l}{40mm}
\begin{tabular}{l | c}
A & Cell 1 \\ \hline
B & Cell 2 \\ \hline
\end{tabular}
Some random text
\end{wraptable}

This should be to the left of the table. \blindtext

-
Thanks. Final question... can you recommend a document/site that would contain this and other similar information? –  haroldcampbell Jan 11 '12 at 23:04
@haroldcampbell It always helps to read the package documentation: doing texdoc wrapfig from the Command Line/Terminal would reveal the existence of the wraptable environment. –  Joseph Wright Jan 12 '12 at 6:50
Thanks. Didn't know about that command. –  haroldcampbell Jan 12 '12 at 14:30