# My table is overflowing to the second text column

I have used this code.

\usepackage{caption}
\usepackage{tabularx,ragged2e,booktabs,caption}

\begin{document}
\captionof{table}{GA parameters}\label{title}
\begin{tabular}{|p{3cm}||p{4cm}||p{5cm}||p{4cm}|}
\hline
%\multicolumn{2}{|c|}{Parameter of GA} \\
\hline
Technique         &  Aim    & distinctive attribute & Limitations \\
\hline
Maximum iteration & Total result&   house hold appliance       &      porpery        \\
Population size   & &          &                  \\
$P_{c}$           &\&          &                   \\
$P_{m}$           &\rmfamily  0.1&          &                     \\
\hline
\end{tabular}
\end{center}
\end{document}

• Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Moriambar Apr 26 '17 at 19:16
• Also, your column specification indicate at least 16 cm of space for the table. it seems a bit much to me – Moriambar Apr 26 '17 at 19:19
• The code is still not compilable – user31729 Apr 26 '17 at 19:23
• Dear moriambar! I have corrected my question according to your suggestion. – Shane Apr 26 '17 at 19:23
• It has no documentclass still, but the code you posted certainly cannot produce a 200 in the aim column, since there's no 200 in your code – Moriambar Apr 26 '17 at 19:24

Because your table is wider than the width of one column, it spans the two columns. You can use the starred version of table* and use whatever column specifications you need like this:

\documentclass[12pt]{IEEEtran}
\usepackage{tabularx,ragged2e,booktabs}
\begin{document}

\begin{table*}\centering
\caption{GA parameters}\label{title}
\begin{tabular}{p{3cm}p{4cm}p{5cm}p{4cm}}
\toprule
Technique         & Aim & distinctive attribute & Limitations \\ \midrule
Maximum iteration & 200 & house hold appliance  & porpery     \\
Population size   & 30  &                       &             \\
$P_{c}$           & 0.9 &                       &             \\
$P_{m}$           & 0.1 &                       &             \\ \bottomrule
\end{tabular}
\end{table*}

\end{document}


• Dear Aboammar!! Thanks for your help. But I want this big table i.e, table from to right of the page but my text in there. – Shane Apr 26 '17 at 19:33
• @Shane: Please see my edit! – AboAmmar Apr 26 '17 at 19:35
• Aboammar if I want to adjust width of my desire how I do that i.e, in tabular case I do like with double column line {|p{3cm}||p{4cm}||p{5cm}||p{4cm}|}. – Shane Apr 26 '17 at 19:47
• Yes, you can do the same, remove tabularx and put tabular and remove all vertical bars. See my re-edit! – AboAmmar Apr 26 '17 at 19:50

Ok, not knowing your setup, but deducing it from the text, I assume you have a two column environment/documentclass, since it's the only way I can reproduce your problem.

This is a suggestion for correcting the code, i.e. using the table* environment in order to typeset the table. I took the liberty of removing all of the extra separators:

\documentclass{article}
\usepackage{booktabs}
\usepackage{lipsum}
\usepackage{caption}
\usepackage{multicol}
\begin{document}
\begin{multicols}{2}
\lipsum
\begin{table*}
\centering
\caption{GA parameters}\label{title}
\begin{tabular}{@{}lccc@{}}
\toprule
Technique&Aim&distinctive attribute &limitations\\
\midrule
Maximum iteration & 300 &household appliance&porpery\\
Population size& 30& & \\
$P_{c}$& 0.9& & \\
$P_{m}$&0.1& & \\
\bottomrule
\end{tabular}
\end{table*}
\lipsum[50-76]

\section{sss}

\lipsum[10-55]
\end{multicols}
\end{document}


Result:

• Oh Moria thanks you are right I guess!! But I got an error to adjust so many things as I am a beginner in latex. – Shane Apr 26 '17 at 19:47
• @Shane we've all been beginners. Take one step at a time, and browse around the most asked/most voted questions on this website to find advice – Moriambar Apr 26 '17 at 19:49
• Really Thank you Moria! Keep in touch me and keep guide me. – Shane Apr 26 '17 at 20:11