table length width adjustment in two column article

3,442 views
Skip to first unread message

Muhammad Imran Khan

unread,
Jun 30, 2013, 8:59:48 AM6/30/13
to latexus...@googlegroups.com
Hi :), 

Please, I need help regarding two column article in which I have to adjust tables length width as like width of  column. The example code is below, it cross over to the second column  of the same page. I need the it should wrapped only and only in the same column width. 

\begin{table}[h]
\centering
\caption{Density based DTxPC}
\label{tab:tabl-densDTxPC}
\begin{tabular}{|c|c|c|c|c|c|} 
\hline
\textbf{Protocol} & \textbf{Density} & \textbf{TxPower} & \textbf{Delay} & \textbf{Cost}  & \textbf{Advantage} \\ \hline
\hline
PCAHCA \cite{Caizzone2005} & ++ & -- & ++  & Scalability &  Connectivity \\ \hline
\hline
\end{tabular}
\end{table}

Thanks in advance for help and cooperation. 

Best Regards,
Imran 

Peter Flynn

unread,
Jun 30, 2013, 6:32:53 PM6/30/13
to latexus...@googlegroups.com
On Sun, Jun 30, 2013 at 1:59 PM, Muhammad Imran Khan <xpti...@gmail.com> wrote:
Hi :), 

Please, I need help regarding two column article in which I have to adjust tables length width as like width of  column. The example code is below, it cross over to the second column  of the same page. I need the it should wrapped only and only in the same column width. 

Hint: always give a fully-worked minimal example, otherwise we don't know the page size, the margins, the font size, etc. In this example I have guessed. 

\documentclass[a4paper,twocolumn]{article}
\usepackage{lipsum,array}
\begin{document}
\title{foo}
\author{bar}
\maketitle
\lipsum[1]

\begin{table}[h]
\small\centering
\caption{Density based DTxPC}
\label{tab:tabl-densDTxPC}
\begin{tabular}{@{}|*6{>{\strut}m{.1\columnwidth}|}@{}} 
\hline
\textbf{Pro\-to\-col} & 
\textbf{Den\-si\-ty} & 
\textbf{Tx Pow\-er} & 
\textbf{Delay} & 
\textbf{Cost}  & 
\textbf{Ad\-van\-tage} \\ \hline
\hline
PCA\-HCA \cite{Caizzone2005} & ++ & $--$ & ++  & Sca\-la\-bi\-li\-ty &  Con\-nec\-ti\-vi\-ty \\ \hline
\hline
\end{tabular}
\end{table}

\lipsum[2]

\begin{table}[h]
\small\centering
\caption{Density based DTxPC}
\label{tab:tabl-densDTxPC}
\begin{tabular}{@{}|>{\strut}l||>{\strut}l|@{}} 
\hline
\textbf{Protocol} & PCAHCA \cite{Caizzone2005} \\\hline
\textbf{Density} & ++ \\\hline
\textbf{Tx Power} & $--$ \\\hline
\textbf{Delay} & ++ \\\hline
\textbf{Cost}  & Scalability \\\hline
\textbf{Advantage} & Connectivity \\ \hline
\end{tabular}
\end{table}

\lipsum[3]
\end{document}

To force a table into a narrow space, use the p/m/b columns (package array needed), and specify all possible hyphenation-points. This will work, but is incredibly ugly, and suitable only for drafts (and, I am tempted to say, the editors of engineering journals :-)

The second table has the rows and columns transformed. This is easier to read and easier to fit.

///Peter

test.pdf

Muhammad Imran Khan

unread,
Jul 2, 2013, 9:35:40 AM7/2/13
to latexus...@googlegroups.com
Thanks you so much Peter, the second example has better display. 

I am using IEEEtran class as article writing, I need to insert tables in the article. Now there are many column as compared to rows in my table, i have to insert. 
I prefer to set table on page by breaking the two column text, i.e. table should appear on the page but not restricted to fit in the one text column width. 
I need to break the two columns, then insert the table, then continue the text in two columns. 

Thanks for your cooperation. 

Best Regards,
Imran 

Peter Flynn

unread,
Jul 3, 2013, 6:42:08 AM7/3/13
to latexus...@googlegroups.com
On Tue, Jul 2, 2013 at 2:35 PM, Muhammad Imran Khan <xpti...@gmail.com> wrote:
Thanks you so much Peter, the second example has better display. 

I am using IEEEtran class as article writing,

Have you read the documentation for the IEEEtran class? This is important.

On a Unix-based system (Linux, Mac), type texdoc IEEEtran in a Terminal window.
On a Windows system I don't know, but it's available in the normal place

See Section X subsection D "Double Column Floats" on p.10

///Peter
 
--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to latexusersgro...@googlegroups.com.
To post to this group, send email to latexus...@googlegroups.com.
Visit this group at http://groups.google.com/group/latexusersgroup.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Muhammad Imran KHAN

unread,
Jul 3, 2013, 8:14:38 AM7/3/13
to latexus...@googlegroups.com
Thanks you so much. 

Anyhow I found the answer from the IEEEtran document. 
Just putting * resolve the issue, 

\begin{table*}
xxxx
\end{table*}

Muhammad Imran KHAN

unread,
Jul 16, 2013, 9:46:32 AM7/16/13
to latexus...@googlegroups.com
I have an other problem regarding the position of the table in the IEEE article.

Every table appears at the end of the document, But I want to put the table where i want in between corresponding pages. 
How can I do that ? Please help me,  I have read the IEEEtran document but I could not be able to get what I want. 

\begin{table*}[h]
\small\centering
\caption{Message Broadcasting based DTxPC}
\label{tab:tabl-msgBrdDTxPC}
%
\begin{tabular}{@{}|>{\strut}l||>{\strut}l|@{}|>{\strut}l@{}|>{\strut}l@{}|>{\strut}l@{}|>{\strut}l@{}} 
\hline
\textbf{Protocol} & \textbf{Broadcast} & \textbf{TxPower}  & \textbf{Throughput}  & \textbf{MAC Scheme} \\\hline
\hline
\textbf{PCAHCA}\cite{Caizzone2005} & Single Hop &  - - &  + + & 802.11 \\\hline
\textbf{PMBP}\cite{Yuangou2009} & Multi Hop &  ==  &  - - & 802.11e  \\\hline
\textbf{DAJTPCW}\cite{Rawat2009} &  Single Hop & - - & ++ & 802.11e \\\hline
\textbf{EAEP}\cite{Nekovee2007} & Multi Hop & - - & ++ & 802.11 \\\hline
\textbf{ROR}\cite{XiaominMa2011} & Single Hop & ==& ++ & 802.11 \\\hline
\end{tabular}
%
\end{table*}
%

I thank you so much. 



Best Regards,
Imran 


Peter Flynn

unread,
Jul 16, 2013, 7:04:45 PM7/16/13
to latexus...@googlegroups.com
On Tue, Jul 16, 2013 at 2:46 PM, Muhammad Imran KHAN <xpti...@gmail.com> wrote:
I have an other problem regarding the position of the table in the IEEE article.

Every table appears at the end of the document,

This is usually because the first table is too large to fit anywhere. 

When this happens, LaTeX puts it at the end. In order to maintain the correct sequence, all following floats (tables or figures) must also therefore go to the end.
 
But I want to put the table where i want in between corresponding pages. 

Fix the first one, and they will start to appear where you want them. If the same happens with a later table, it must also be fixed so that it fits. Check the log file for overfull \hbox errors: this will show the amount (in pt) that the table is too wide.
 
How can I do that ? Please help me,  I have read the IEEEtran document but I could not be able to get what I want. 

This is a LaTeX problem, not really an IEEEtran problem, I think.

///Peter 

Muhammad Imran KHAN

unread,
Jul 18, 2013, 8:16:15 AM7/18/13
to latexus...@googlegroups.com
Thank you so much Peter, 
Anyhow, I changed the option as [h] to [t]

\begin{table*}[t]

At least tables appear in between the article pages. By changing I get rid of to appear them at the end of the article. 


Best Regards,
Imran Khan




Reply all
Reply to author
Forward
0 new messages