LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-29-2006, 09:54 AM   #1
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Rep: Reputation: 30
latex, floating tables side by side?


Hey guys,

I am trying to float two tables to the top of the page to span across both columns of an IEEE journal style paper, so I did doing this:

Code:
\begin{figure*}
\centering
\label{fig:sdevalarms}
  \begin{tabular}{|l|c|c|c|c|c|}
    \hline    
              & D\_IN   & D\_OUT  & R\_ADDR & PORT    & FSD     \\
    \hline
    D\_IN     &   -     & 83.67\% & 73.47\% & 75.51\% & 18.37\% \\
    \hline
    D\_OUT    & 56.16\% &   -     & 67.12\% & 65.75\% & 17.80\% \\
    \hline
    R\_ADDR   & 52.17\% & 71.01\% &   -     & 91.30\% & 18.84\% \\
    \hline
    PORT      & 55.22\% & 71.64\% & 94.03\% &   -     & 16.42\% \\
    \hline
    FSD       & 20.00\% & 28.89\% & 28.89\% & 24.44\% &   -     \\
    \hline
  \end{tabular}

  \begin{tabular}{|l|c|c|c|c|c|}
    \hline    
              & D\_IN   & D\_OUT  & R\_ADDR & PORT    & FSD     \\
    \hline
    D\_IN     &   -     & 78.95\% & 62.11\% & 65.26\% & 29.47\% \\
    \hline
    D\_OUT    & 39.47\% &   -     & 37.89\% & 38.95\% & 17.89\% \\
    \hline
    R\_ADDR   & 52.68\% & 64.29\% &   -     & 86.61\% & 46.43\% \\
    \hline
    PORT      & 55.86\% & 66.67\% & 87.39\% &   -     & 40.54\% \\
    \hline
    FSD       & 33.73\% & 40.96\% & 62.65\% & 54.22\% &   -     \\
    \hline
  \end{tabular}
\caption{Wavelet based anomaly detection}
\end{figure*}
Except, doing that floats them, but they are directly on top of each other. I'd like them to be side by side with about an inches worth of space between them.

Any ideas?

Thanks!
George
 
Old 10-29-2006, 10:14 AM   #2
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
You should probably use a longtable environment to achieve fancy effects with tables instead of using a floating environment.

One idea is instead of having two separate tables, try and achieve the same visual effect by using a single table with columns to hold both the tables.

Last edited by vharishankar; 10-29-2006 at 10:16 AM.
 
Old 10-29-2006, 10:27 AM   #3
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Original Poster
Rep: Reputation: 30
got it, thanks for the suggestion:

Code:
\begin{table*}[htbp]
\label{table:alarms}
\centering
  \begin{minipage}{8.5cm}
  \begin{tabular}{|l|c|c|c|c|c|}
    \hline    
              & D\_IN   & D\_OUT  & R\_ADDR & PORT    & FSD     \\
    \hline
    D\_IN     &   -     & 83.67\% & 73.47\% & 75.51\% & 18.37\% \\
    \hline
    D\_OUT    & 56.16\% &   -     & 67.12\% & 65.75\% & 17.80\% \\
    \hline
    R\_ADDR   & 52.17\% & 71.01\% &   -     & 91.30\% & 18.84\% \\
    \hline
    PORT      & 55.22\% & 71.64\% & 94.03\% &   -     & 16.42\% \\
    \hline
    FSD       & 20.00\% & 28.89\% & 28.89\% & 24.44\% &   -     \\
    \hline
  \end{tabular}
  \caption{Standard deviation detection methods}
  \end{minipage}
  \begin{minipage}{8.5cm}
  \begin{tabular}{|l|c|c|c|c|c|}
    \hline    
              &  D\_IN  & D\_OUT  & R\_ADDR & PORT    & FSD     \\
    \hline
    D\_IN     &   -     & 78.95\% & 62.11\% & 65.26\% & 29.47\% \\
    \hline
    D\_OUT    & 39.47\% &   -     & 37.89\% & 38.95\% & 17.89\% \\
    \hline
    R\_ADDR   & 52.68\% & 64.29\% &   -     & 86.61\% & 46.43\% \\
    \hline
    PORT      & 55.86\% & 66.67\% & 87.39\% &   -     & 40.54\% \\
    \hline
    FSD       & 33.73\% & 40.96\% & 62.65\% & 54.22\% &   -     \\
    \hline
  \end{tabular}
  \caption{Wavelet based anomaly detection}
  \end{minipage}

\end{table*}
 
Old 10-29-2006, 10:39 AM   #4
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Glad you got it.

I would still prefer the longtable solution over using floats. To me using the longtable environment is cleaner for more complex tabular presentation.

Here's a link if you wish:
http://www.fi.infn.it/pub/tex/doc/orig/longtable.pdf

Last edited by vharishankar; 10-29-2006 at 10:40 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse pointer moves up and down when mouse moved side to side hustla Slackware 6 10-29-2006 03:11 PM
Is screen what im looking for for side by side shells? dr_zayus69 Linux - Software 9 05-01-2006 02:53 AM
Cant get WAN side ip...... hkl8324 Linux - Wireless Networking 1 06-08-2005 06:03 AM
C and C++ side-by-side examples Burgin Programming 5 09-17-2004 01:42 PM
help with client side NFS-firewall setup and server side NIS-firewall setup niverson Linux - Networking 3 02-02-2004 08:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration