我有一个表格,其中的列太多,以至于与页面的右列重叠。现在,我想将表格拆分成几部分,以便将第 35-50 列放置在第 10-30 列下方,但仍然保留同一张表格。
目前,这是我的代码:
\documentclass{eusflat2021}
\begin{table}[ht]
\begin{center}
\vspace{1ex}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|} \hline
{\bf GTW} & {\bf 10} & {\bf 15} & {\bf 20} & {\bf 25} & {\bf 30} & {\bf 35} & {\bf 40} & {\bf 45} & {\bf 50} \\\hline
Entropy & & &&&&&&& \\
IDF & 0.4301& 0.4552&0.4627&0.4648&4610&0.4523&0.4270&0.4349&0.4337 \\
Normal & 0.4856 & 0.4802 &0.4769&0.4266&0.4181&0.4176&0.3877&0.3724&0.3555\\
ProbIDF &0.3333&0.3628&0.3717&0.3831&0.3697&0.3773&0.3712&0.3608&0.3705\\
Normal-alt & 0.5598&0.5066&0.5077&0.4685&0.4876&0.4784&0.44934515&0.4420\\
\hline
\end{tabular}
\caption{\label{table}The number and caption of the table always appear below the table.}
\end{center}
\end{table}
我已经发现这一页,但我不清楚如何在我的代码中实现这一点。
谁能给我举个例子说明如何做到这一点?
答案1
您可以让表格占据两列,以避免拆分表格。或者,我还提供了一个版本,我将表格拆分成三部分,以便将其放入其中一列。
附注:代码中包含一些我个人会避免使用的行,例如center
环境和\vspace
。我决定保留它们,因为这个特定的模板也包含它们。然而,我还是忍不住要\bf
改成\bfseries
。
\documentclass{eusflat2021}
\usepackage{lipsum} % For dummy text. Do not use in real document.
\usepackage{array}
\begin{document}
\begin{table*}
\begin{center}
\vspace{1ex}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|} \hline
{\bfseries GTW} & {\bfseries 10} & {\bfseries 15} & {\bfseries 20} & {\bfseries 25} & {\bfseries 30} & {\bfseries 35} & {\bfseries 40} & {\bfseries 45} & {\bfseries 50} \\\hline
Entropy & & &&&&&&& \\
IDF & 0.4301& 0.4552&0.4627&0.4648&4610&0.4523&0.4270&0.4349&0.4337 \\
Normal & 0.4856 & 0.4802 &0.4769&0.4266&0.4181&0.4176&0.3877&0.3724&0.3555\\
ProbIDF &0.3333&0.3628&0.3717&0.3831&0.3697&0.3773&0.3712&0.3608&0.3705\\
Normal-alt & 0.5598&0.5066&0.5077&0.4685&0.4876&0.4784&0.44934515&0.4420 &\\
\hline
\end{tabular}
\caption{\label{table}The number and caption of the table always appear below the table.}
\end{center}
\end{table*}
\lipsum
\begin{table}[ht]
\begin{center}
\vspace{1ex}
\setlength{\tabcolsep}{5pt}
\begin{tabular}{|l|*{3}{wc{4.5em}|}} \hline
{\bfseries GTW} & {\bfseries 10} & {\bfseries 15} & {\bfseries 20} \\\hline
Entropy & & & \\
IDF & 0.4301 & 0.4552 & 0.4627 \\
Normal & 0.4856 & 0.4802 & 0.4769 \\
ProbIDF & 0.3333 & 0.3628 & 0.3717 \\
Normal-alt & 0.5598 & 0.5066 & 0.5077 \\
\hline
{\bfseries GTW} & {\bfseries 25} & {\bfseries 30} & {\bfseries 35} \\\hline
Entropy & & & \\
IDF & 0.4648 & 4610 & 0.4523 \\
Normal & 0.4266 & 0.4181 & 0.4176 \\
ProbIDF & 0.3831 & 0.3697 & 0.3773 \\
Normal-alt & 0.4685 & 0.4876 & 0.4784 \\
\hline
{\bfseries GTW} & {\bfseries 40} & {\bfseries 45} & {\bfseries 50} \\\hline
Entropy & & & \\
IDF & 0.4270 & 0.4349 & 0.4337 \\
Normal & 0.3877 & 0.3724 & 0.3555 \\
ProbIDF & 0.3712 & 0.3608 & 0.3705 \\
Normal-alt & 0.44934515 & 0.4420 & \\
\hline
\end{tabular}
\caption{\label{table}The number and caption of the table always appear below the table.}
\end{center}
\end{table}
\lipsum
\end{document}