使表格跨越多列

使表格跨越多列

我有一些表格数据和两列页面布局。列数太多,表格无法容纳在一列中。如何让表格跨越两列,并使表格居中。我不想将其拉伸到整个。只需占用两列并居中,因为它不够大,无法占据整个空间。有什么建议吗?

答案1

这应该会有所帮助。它只是展示了使用 Harish 的建议后你的代码应该是什么样子:

\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}

这是结果的屏幕截图。 第 1 页 第2页

相关内容