Generalproblem with table handling

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
dc.sara
Posts: 1
Joined: Thu Feb 28, 2008 3:53 pm

problem with table handling

Post by dc.sara »

Hello,

i use tables which are not large, so i need to place two table in the same line,
Please can you help me and indicate to me how to do this ?

thanks,

Sara

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

problem with table handling

Post by gmedina »

To handle sub-floats, you can use the subfig package. Take a look at the following simple exampĺe:

\documentclass{article}
\usepackage{subfig}

\begin{document}

%two floating tables side by side each with its own caption and label
\begin{table}
\centering
\subfloat[First table.]{%
\begin{tabular}{ccc}\hline
\multicolumn{3}{c}{\label{tab:subtable1}First table} \\ \hline
a & b & c \\
d & e & f \\ \hline
\end{tabular}}\qquad
\subfloat[Second table.]{%
\begin{tabular}{ccc}\hline
\multicolumn{3}{c}{\label{tab:subtable2}Second table} \\ \hline
a & b & c \\
d & e & f \\ \hline
\end{tabular}}
\caption{Two sub-floats.}
\label{tab:2tables}
\end{table}
Table~\ref{tab:2tables} contains two top ‘sub-floats’. The first one is table~\ref{tab:subtable1} and the second one is table~\ref{tab:subtable2}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply