[Tex/LaTex] Formatting a table in a two-column document

ieeetrantablestwo-column

I am trying to write a paper in IEEE format which includes tables. It's a two-column document. But when I am trying to create the table it overlaps with material in the other column, like the following image:

The code of the table is as follows:

\begin{table}[!ht]
\begin{center}
    \caption{Actors vs Positional Dynamicity (based on Closeness Centrality) in Different LSNs} \label{pos1}
    \begin{tabular}{|c||c| c| c| c| c|}  
        \hline

        Actor No. & LSN 1 & LSN 2 & LSN 3 & ...  & LSN 60   \\ [0.5ex] 
        \hline\hline
        1 &0.205602  &0.262515  & 0.247979  &... & 0.170467  \\ 
        \hline
        2 &0.00961852  &0.0200901  & 0.0207746  &... & 0.107013 \\
        \hline
        3 &0.1271  & 0.170967 &  0.199928  &... &0.173208  \\
        \hline
        4 & 0.00263733 & 0.00524802 & 0.00787202  &... &0.0100803  \\
        \hline
        5 & 0.00300429 &0.00597824  &  0.00673418  &... & 0.00706005 \\ 
        \hline
        ... & ... & ... & ...   &...  .  &...    \\
        \hline
        1899 &0.00994494  &0.00968842  & 0.0216411   &...&0.0610909  \\
        \hline 
    \end{tabular}
\end{center}
\end{table}

Is there any way to resize the table modifying the above code so that it doesn't get intersected with the other column?

Best Answer

I suggest you (a) get rid of all vertical lines and most horizontal lines, use the line-drawing macros of the booktabs package for the remaining few lines to give the table a more open look and (b) use a tabular* environment and let LaTeX figure out the permissible amount of intercolumn whitespace. You may also want to align the numbers on their decimal markers using, say, the siunitx package and its S column type.

enter image description here

\documentclass[twocolumn]{IEEEtran}
\usepackage{lipsum,booktabs,siunitx}
\newcolumntype{T}[1]{S[table-format=#1,group-digits=false]}
\begin{document}
\lipsum[2] % filler text

\begin{table}[!ht]
% let LaTeX figure out optimal amount of intercolumn whitespace:
\setlength\tabcolsep{0pt} 
\caption{Actors vs.\ Positional Dynamicity (based on 
Closeness Centrality) in Different LSNs} \label{pos1}
\begin{tabular*}{\columnwidth}{@{\extracolsep{\fill}}c*{3}{T{1.8}}cT{1.8}}  
\toprule
Actor No. & {LSN 1} & {LSN 2} & {LSN 3}   & $\cdots$ & {LSN 60} \\
\midrule
1 &0.205602    &0.262515    & 0.247979    & $\cdots$ & 0.170467  \\ 
2 &0.00961852  &0.0200901   & 0.0207746   & $\cdots$ & 0.107013  \\
3 &0.1271      & 0.170967   &  0.199928   & $\cdots$ & 0.173208  \\
4 & 0.00263733 & 0.00524802 & 0.00787202  & $\cdots$ & 0.0100803 \\
5 & 0.00300429 &0.00597824  &  0.00673418 & $\cdots$ & 0.00706005\\ 
$\cdots$ & $\cdots$ & $\cdots$ & $\cdots$ & $\cdots$ & $\cdots$  \\
1899&0.00994494 &0.00968842 & 0.0216411   & $\cdots$ & 0.0610909 \\
\bottomrule 
\end{tabular*}
\end{table}
\lipsum[2-10] % more filler text
\end{document}
Related Question