Table width equal line width
I would suggest stacking the headings, and perhaps eliminate the duplication of "Number", since it should be obvious:
\documentclass[twocolumn]{article}
\usepackage{booktabs,lipsum}% http://ctan.org/pkg/{booktabs,lipsum}
\begin{document}
\lipsum[1]
\begin{table}
\centering
\begin{tabular}{ccc}
\toprule
Generated & Real & Ratio of \\
cluster & cluster & mapped spikes\\
\midrule
2 & 3 & 0.4233 \\
3 & 2 & 0.3545 \\
4 & 1 & 0.8463 \\
5 & 1 & 0.3432 \\
6 & 3 & 0.6345 \\
7 & 2 & 0.2349 \\
8 & 2 & 0.4267 \\
\bottomrule
\end{tabular}
\caption{A table}
\end{table}
\lipsum[2-5]
\end{document}
I've used booktabs
, which inherently discourages the use of vertical lines. However, the example would work even without if you reinstate the vertical and horizontal rules. booktabs
just provides the necessary eye-candy for tabular
.
You can use the starred version of tabular
environment and a p{}
modifier for column alignment with custom size, based on \linewidth
.
\documentclass[twocolumn]{article}
\usepackage{booktabs}
\usepackage{lipsum}
\begin{document}
\begin{table}[t]
\centering\small
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}p{0.3\linewidth}p{0.3\linewidth}p{0.3\linewidth}@{}}
\toprule
Generated Cluster Number & Real Cluster Number & Ratio of mapped spikes \\
\midrule
2 & 3 & 0.4233 \\
3 & 2 & 0.3545 \\
4 & 1 & 0.8463 \\
5 & 1 & 0.3432 \\
6 & 3 & 0.6345 \\
7 & 2 & 0.2349 \\
8 & 2 & 0.4267 \\
\bottomrule
\end{tabular*}
\label{tab:template}
\end{table}
\lipsum[1-5]
\end{document}