How can I have multiple tables that wrap

492 views
Skip to first unread message

Chris Melnick

unread,
Apr 14, 2009, 8:40:09 PM4/14/09
to LaTeX Users Group
Hey,
I have lots of little tables in my document. LaTeX puts a line break
between each of them automatically. Is there a way to force it to wrap
as many tables as can fit in the width of the document? Not a huge
deal, but it's taking up a lot of space right now since my tables are
just 2 columns.

e.g.:
Currently LaTeX formats as:
<----------------------------- Page Width
------------------------------>
[TABLE1]
[TABLE2]
[TABLE3]
[TABLE4]
[TABLE5]
[TABLE6]

I would like:
<----------------------------- Page Width
------------------------------>
[TABLE1] [TABLE2] [TABLE3] [TABLE4]
[TABLE5] [TABLE6]

Thanks in advance!

jon

unread,
Apr 15, 2009, 12:34:12 AM4/15/09
to LaTeX Users Group
On Apr 14, 8:40 pm, Chris Melnick <cmeln...@gmail.com> wrote:
> Hey,
> I would like:
> <----------------------------- Page Width
> ------------------------------>
> [TABLE1]   [TABLE2]   [TABLE3]  [TABLE4]
> [TABLE5]   [TABLE6]


you could do something like the example below (using the famous
example of a 'bad' latex table and the revised version suggested in
the booktabs package --- though here modified from the memoir manual):

cheers,
jon.

% ---------------------8<--------------------- %

\documentclass{article}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{subfig}

\begin{document}

\begin{figure}
\centering
\caption{Two views of one table} \label{tab:twoviews}
\subfloat[Before]{\label{tab:before}%
\begin{tabular}{||l|lr||} \hline
gnats & gram & \$13.65 \\ \cline{2-3}
& each & .01 \\ \hline
gnu & stuffed & 92.50 \\ \cline{1-1} \cline{3-3}
emu & & 33.33 \\ \hline
armadillo & frozen & 8.99 \\ \hline
\end{tabular}
}
\hfill
\subfloat[After]{\label{tab:after}%
\begin{tabular}{@{}llr@{}} \toprule
\multicolumn{2}{c}{Item} \\ \cmidrule(r){1-2}
Animal & Description & Price (\$)\\ \midrule
Gnat & per gram & 13.65 \\
& each & 0.01 \\
Gnu & stuffed & 92.50 \\
Emu & stuffed & 33.33 \\
Armadillo & frozen & 8.99 \\ \bottomrule
\end{tabular}
}
\end{figure}

\end{document}
Reply all
Reply to author
Forward
0 new messages