Graphics, Figures & TablesTable side by side

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
pjas002
Posts: 2
Joined: Sun Jul 18, 2010 9:53 am

Table side by side

Post by pjas002 »

I want to display 3 tables side by side with an arrow connecting them. I also want to write something on top of this arrow. Can someone please tell me how to do this in latex? Following is the code, but that displays table underneath another one and i want side by side. Any help would be appreciated..Thanks

Code: Select all

\documentclass[twocolumn, a4paper]{article}

\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}

\begin{tabular}{c}
    Table Model
 \end{tabular}

 \begin{tabular}{ | l |}
    \hline
    \textbf{Name}  \\ \hline
    Joe \\ \hline
    Fred  \\ \hline
    Bob \\ \hline
    Mary \\ \hline
\end{tabular}

\begin{tabular}{c}
    Sorting Filter
\end{tabular}

\begin{tabular}{ | l |}
    \hline
    \textbf{Mappings}  \\ \hline
    1 \begin{math} \rightarrow \end{math} 3\\ \hline
    2 \begin{math} \rightarrow \end{math} 2  \\ \hline
    3 \begin{math} \rightarrow \end{math} 1 \\ \hline
    4 \begin{math} \rightarrow \end{math} 4 \\ \hline
\end{tabular}

\begin{tabular}{c}
    View
\end{tabular}

 \begin{tabular}{ | l |}
    \hline
    \textbf{Name}  \\ \hline
    Bob \\ \hline
    Fred  \\ \hline
    Joe \\ \hline
    Mary \\ \hline
\end{tabular}


\end{document}


Last edited by pjas002 on Sun Jul 18, 2010 4:15 pm, edited 1 time in total.

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Table side by side

Post by localghost »

Empty lines in the source code are interpreted as a new paragraph. So you can either insert »%« for a comment or try something like shown below.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{document}
  \begin{tabular}{|l|}
    \multicolumn{1}{c}{Table Model} \\ \hline
    \textbf{Name} \\ \hline
    Joe \\ \hline
    Fred \\ \hline
    Bob \\ \hline
    Mary \\ \hline
  \end{tabular}
  \hfill$\stackrel{=}{\longrightarrow}$\hfill
  \begin{tabular}{|l|}
    \multicolumn{1}{c}{Sorting Filter} \\ \hline
    \textbf{Mappings} \\ \hline
    1 \begin{math} \rightarrow \end{math} 3 \\ \hline
    2 \begin{math} \rightarrow \end{math} 2 \\ \hline
    3 \begin{math} \rightarrow \end{math} 1 \\ \hline
    4 \begin{math} \rightarrow \end{math} 4 \\ \hline
  \end{tabular}
  \hfill$\stackrel{=}{\longrightarrow}$\hfill
  \begin{tabular}{|l|}
    \multicolumn{1}{c}{View} \\ \hline
    \textbf{Name} \\ \hline
    Bob \\ \hline
    Fred \\ \hline
    Joe \\ \hline
    Mary \\ \hline
  \end{tabular}
\end{document}

Best regards and welcome to the board
Thorsten
pjas002
Posts: 2
Joined: Sun Jul 18, 2010 9:53 am

Re: Table side by side

Post by pjas002 »

Thanks very much.That solved the problem
Post Reply