[Tex/LaTex] Making a table span multiple columns

multicolumn

I have some tabular data and two column page layout. The number of columns is bigger such that that the table cannot fit into one column. How can I make the table span two columns such that the table is centered. I don't want to stretch it to the whole. Just take up two columns and center it since it is not big enough to take the whole space. Any suggestions?

Best Answer

This should help. It just shows how your code should look like after using Harish's recommendation:

\documentclass[twocolumn]{article}
\usepackage{lipsum}%Just for introducing dummy text.
\usepackage{dblfloatfix}

\begin{document}
\lipsum[1-4]%dummy text
\begin{table*}[h]%Using table* instead of table is what makes the table use the two columns.
    \centering
    \begin{tabular}{|c|c|c|}
    Data & Data & Data \\
    Data & Data & Data \\
    Data & Data & Data \\
    \end{tabular}
    \caption{This is a table with data}
\end{table*}
\lipsum[3-10]%Dummy text
\end{document}

Here's a screenshot of the result. page 1 page 2