我无法让表格适合页面,如何才能让它适合页面?以下是我的表格的屏幕截图。
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
\usepackage{cite}
\usepackage[table,xcdraw]{xcolor}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage{textcomp}
\usepackage{xcolor}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\usepackage{booktabs, makecell, multirow, tabularx}
\newcommand\mytab[1]{\begin{tabular}[t]{@{}c@{}} #1 \end{tabular}}
\newcommand\mc[2]{\multicolumn{#1}{c}{#2}}
\renewcommand{\algorithmiccomment}[1]{//#1}
\renewcommand{\algorithmiccomment}[1]{//#1}
\usepackage{multirow, tabularx, ragged2e}
\newcolumntype{C}{>{\Centering\arraybackslash}X}
\begin{table*}[]
\caption{Results for Different Types of Seeding with each one across 10 Iterations }
\label{tab:results}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\multirow{2}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}1-\\ Seed.\\ Type\end{tabular}}} & \multirow{2}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}2-\\ Seed.\\ Type\end{tabular}}} & \multirow{2}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}3-\\ Prog.\end{tabular}}} & \multicolumn{2}{c|}{\textbf{Validation}} & \multicolumn{2}{c|}{\textbf{Contradiction}} & \textbf{Fail} & \multicolumn{2}{c|}{\textbf{AutoCompletion}} & \multicolumn{3}{c|}{\textbf{Predictions}} & \multicolumn{2}{c|}{\textbf{Precision}} & \multicolumn{2}{c|}{\textbf{Recall}} \\ \cline{4-17}
& & & \textbf{\begin{tabular}[c]{@{}c@{}}4-\\ TP\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}5-\\ TN\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}6-\\ FP\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}7-\\ FN\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}8-\\ U\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}9-\\ U-\textgreater{}T\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}10-\\ U-\textgreater{}N\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}11-\\ Tp\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}12-\\ Np\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}13-\\ Up\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}14-\\ Tr.\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}15-\\ No\\ Tr.\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}16-\\ Tr\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}17-\\ No\\ Tr.\end{tabular}} \\ \hline
\multirow{12}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}Incomp.\\ Seed.\end{tabular}}} & \multirow{6}{*}{\textbf{TtoE}} & \textbf{Chess} & 1692 & 14214 & 195 & 578 & 35961 & 942 & 7083 & 2829 & 21875 & 27936 & 90 & 96 & 75 & 99 \\ \cline{3-17}
& & \textbf{Gantt} & 600 & 119066 & 104 & 404 & 681906 & 1046 & 128113 & 1750 & 247583 & 552747 & 85 & 100 & 60 & 100 \\ \cline{3-17}
& & \textbf{iTrust} & 564 & 17300 & 34 & 70 & 1652452 & 5426 & 154822 & 6024 & 172192 & 1492204 & 94 & 100 & 89 & 100 \\ \cline{3-17}
& & \textbf{JHot.} & 999 & 35682 & 224 & 302 & 1071193 & 3210 & 82812 & 4433 & 118796 & 985171 & 82 & 99 & 77 & 99 \\ \cline{3-17}
& & \textbf{VOD} & 100 & 3427 & 24 & 134 & 20625 & 172 & 3312 & 296 & 6873 & 17141 & 81 & 96 & 43 & 99 \\ \cline{3-17}
& & \textbf{Avg.} & \textbf{791} & \textbf{37938} & \textbf{116} & \textbf{298} & \textbf{692427} & \textbf{2159} & \textbf{75228} & \textbf{3066} & \textbf{113464} & \textbf{615040} & \textbf{86} & \textbf{98} & \textbf{69} & \textbf{99} \\ \cline{2-17}
& \multirow{6}{*}{\textbf{NtoE}} & \textbf{Chess} & 3644 & 8699 & 710 & 147 & 46960 & 2287 & 4341 & 6641 & 13187 & 40332 & 84 & 98 & 96 & 92 \\ \cline{3-17}
& & \textbf{Gantt} & 1222 & 58617 & 416 & 169 & 741656 & 3042 & 62607 & 4680 & 121393 & 676007 & 75 & 100 & 88 & 99 \\ \cline{3-17}
& & \textbf{iTrust} & 1090 & 9071 & 195 & 38 & 1660026 & 10672 & 74470 & 11957 & 83579 & 1574884 & 85 & 100 & 97 & 98 \\ \cline{3-17}
& & \textbf{JHot.} & 1898 & 22750 & 649 & 101 & 1343802 & 7378 & 55141 & 9925 & 77992 & 1281283 & 75 & 100 & 95 & 97 \\ \cline{3-17}
& & \textbf{VOD} & 206 & 2353 & 102 & 70 & 28209 & 301 & 2137 & 609 & 4560 & 25771 & 67 & 97 & 75 & 96 \\ \cline{3-17}
& & \textbf{Avg.} & \textbf{1612} & \textbf{20298} & \textbf{414} & \textbf{105} & \textbf{764131} & \textbf{4736} & \textbf{39739} & \textbf{6762} & \textbf{60142} & \textbf{719655} & \textbf{77} & \textbf{99} & \textbf{90} & \textbf{97} \\ \hline
\multirow{12}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}Error \\ Seed.\end{tabular}}} & \multirow{6}{*}{\textbf{TtoN}} & \textbf{Chess} & 1268 & 14507 & 206 & 1639 & 35020 & 755 & 7693 & 2229 & 23839 & 26572 & 86 & 90 & 44 & 99 \\ \cline{3-17}
& & \textbf{Gantt} & 463 & 119182 & 108 & 830 & 681497 & 894 & 128952 & 1465 & 248964 & 551651 & 81 & 99 & 36 & 100 \\ \cline{3-17}
& & \textbf{iTrust} & 471 & 17601 & 32 & 353 & 1651963 & 4345 & 157587 & 4848 & 175541 & 1490031 & 94 & 98 & 57 & 100 \\ \cline{3-17}
& & \textbf{JHot.} & 779 & 35811 & 220 & 774 & 1070816 & 2691 & 84181 & 3690 & 120766 & 983944 & 78 & 98 & 50 & 99 \\ \cline{3-17}
& & \textbf{VOD} & 80 & 3490 & 20 & 246 & 20474 & 128 & 3444 & 228 & 7180 & 16902 & 80 & 93 & 25 & 99 \\ \cline{3-17}
& & \textbf{Avg.} & \textbf{612} & \textbf{38118} & \textbf{117} & \textbf{768} & \textbf{691954} & \textbf{1763} & \textbf{76371} & \textbf{2492} & \textbf{115258} & \textbf{613820} & \textbf{84} & \textbf{96} & \textbf{42} & \textbf{99} \\ \cline{2-17}
& \multirow{6}{*}{\textbf{NtoT}} & \textbf{Chess} & 3976 & 5077 & 8021 & 83 & 43003 & 5515 & 2351 & 17512 & 7511 & 35137 & 33 & 98 & 98 & 39 \\ \cline{3-17}
& & \textbf{Gantt} & 1483 & 32547 & 56213 & 102 & 711735 & 59556 & 37253 & 117252 & 69902 & 614926 & 3 & 100 & 94 & 37 \\ \cline{3-17}
& & \textbf{iTrust} & 1222 & 8406 & 14616 & 30 & 1646146 & 103464 & 48752 & 119302 & 57188 & 1493930 & 8 & 100 & 98 & 37 \\ \cline{3-17}
& & \textbf{JHot.} & 2130 & 13188 & 29385 & 65 & 1324432 & 79238 & 27047 & 110753 & 40300 & 1218147 & 7 & 100 & 97 & 31 \\ \cline{3-17}
& & \textbf{VOD} & 290 & 1681 & 1795 & 27 & 27147 & 1858 & 1715 & 3943 & 3423 & 23574 & 14 & 98 & 91 & 48 \\ \cline{3-17}
& & \textbf{Avg.} & \textbf{1820} & \textbf{12180} & \textbf{22006} & \textbf{61} & \textbf{750493} & \textbf{49926} & \textbf{23424} & \textbf{73752} & \textbf{35665} & \textbf{677143} & \textbf{13} & \textbf{99} & \textbf{96} & \textbf{38} \\ \hline
\end{tabular}
\end{table*}
\end{document}
答案1
你的 MWE 有两个问题:1. 你遗漏了\begin{document}
2. 因为这是一份两列文档,你应该使用\begin{table*}
最简单的方法是使用 resizebox。您将缩小表格,因此您需要确保 A. 会议允许该命令,并且 B. 文本仍然可读:
\begin{table*}[]
\centering
\caption{Results for Different Types of Seeding with each one across 10 Iterations }
\label{tab:results}
\resizebox{\textwidth}{!}{
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
.
.
.
\end{tabular}}
\end{table*}
另一个选择是就像在这个问题中,旋转桌子。
\usepackage[graphicx]{realboxes}
.
.
.
\begin{table*}[]
\centering
\caption{Results for Different Types of Seeding with each one across 10 Iterations }
\label{tab:results}
\Rotatebox{90}{
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
.
.
.
\end{tabular}}
\end{table*}
答案2
有了这么多列,而且只有一点点重叠,你可以把\tabcolsep
(列之间的空间)弄小一点。我试过各种方法。
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
\usepackage{cite}
\usepackage[table,xcdraw]{xcolor}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{algorithm}
\usepackage{textcomp}
\usepackage{xcolor}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\usepackage{booktabs, makecell, multirow, tabularx}
\usepackage{showframe}% MWE only
\newcommand\mytab[1]{\begin{tabular}[t]{@{}c@{}} #1 \end{tabular}}
\newcommand\mc[2]{\multicolumn{#1}{c}{#2}}
\renewcommand{\algorithmiccomment}[1]{//#1}
\renewcommand{\algorithmiccomment}[1]{//#1}
\usepackage{multirow, tabularx, ragged2e}
\newcolumntype{C}{>{\Centering\arraybackslash}X}
\begin{document}
\begin{table*}[]
\caption{Results for Different Types of Seeding with each one across 10 Iterations }
\label{tab:results}
\tabcolsep=0.6em %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% new code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\centering
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\multirow{2}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}1-\\ Seed.\\ Type\end{tabular}}} & \multirow{2}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}2-\\ Seed.\\ Type\end{tabular}}} & \multirow{2}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}3-\\ Prog.\end{tabular}}} & \multicolumn{2}{c|}{\textbf{Validation}} & \multicolumn{2}{c|}{\textbf{Contradiction}} & \textbf{Fail} & \multicolumn{2}{c|}{\textbf{AutoCompletion}} & \multicolumn{3}{c|}{\textbf{Predictions}} & \multicolumn{2}{c|}{\textbf{Precision}} & \multicolumn{2}{c|}{\textbf{Recall}} \\ \cline{4-17}
& & & \textbf{\begin{tabular}[c]{@{}c@{}}4-\\ TP\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}5-\\ TN\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}6-\\ FP\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}7-\\ FN\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}8-\\ U\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}9-\\ U-\textgreater{}T\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}10-\\ U-\textgreater{}N\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}11-\\ Tp\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}12-\\ Np\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}13-\\ Up\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}14-\\ Tr.\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}15-\\ No\\ Tr.\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}16-\\ Tr\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}17-\\ No\\ Tr.\end{tabular}} \\ \hline
\multirow{12}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}Incomp.\\ Seed.\end{tabular}}} & \multirow{6}{*}{\textbf{TtoE}} & \textbf{Chess} & 1692 & 14214 & 195 & 578 & 35961 & 942 & 7083 & 2829 & 21875 & 27936 & 90 & 96 & 75 & 99 \\ \cline{3-17}
& & \textbf{Gantt} & 600 & 119066 & 104 & 404 & 681906 & 1046 & 128113 & 1750 & 247583 & 552747 & 85 & 100 & 60 & 100 \\ \cline{3-17}
& & \textbf{iTrust} & 564 & 17300 & 34 & 70 & 1652452 & 5426 & 154822 & 6024 & 172192 & 1492204 & 94 & 100 & 89 & 100 \\ \cline{3-17}
& & \textbf{JHot.} & 999 & 35682 & 224 & 302 & 1071193 & 3210 & 82812 & 4433 & 118796 & 985171 & 82 & 99 & 77 & 99 \\ \cline{3-17}
& & \textbf{VOD} & 100 & 3427 & 24 & 134 & 20625 & 172 & 3312 & 296 & 6873 & 17141 & 81 & 96 & 43 & 99 \\ \cline{3-17}
& & \textbf{Avg.} & \textbf{791} & \textbf{37938} & \textbf{116} & \textbf{298} & \textbf{692427} & \textbf{2159} & \textbf{75228} & \textbf{3066} & \textbf{113464} & \textbf{615040} & \textbf{86} & \textbf{98} & \textbf{69} & \textbf{99} \\ \cline{2-17}
& \multirow{6}{*}{\textbf{NtoE}} & \textbf{Chess} & 3644 & 8699 & 710 & 147 & 46960 & 2287 & 4341 & 6641 & 13187 & 40332 & 84 & 98 & 96 & 92 \\ \cline{3-17}
& & \textbf{Gantt} & 1222 & 58617 & 416 & 169 & 741656 & 3042 & 62607 & 4680 & 121393 & 676007 & 75 & 100 & 88 & 99 \\ \cline{3-17}
& & \textbf{iTrust} & 1090 & 9071 & 195 & 38 & 1660026 & 10672 & 74470 & 11957 & 83579 & 1574884 & 85 & 100 & 97 & 98 \\ \cline{3-17}
& & \textbf{JHot.} & 1898 & 22750 & 649 & 101 & 1343802 & 7378 & 55141 & 9925 & 77992 & 1281283 & 75 & 100 & 95 & 97 \\ \cline{3-17}
& & \textbf{VOD} & 206 & 2353 & 102 & 70 & 28209 & 301 & 2137 & 609 & 4560 & 25771 & 67 & 97 & 75 & 96 \\ \cline{3-17}
& & \textbf{Avg.} & \textbf{1612} & \textbf{20298} & \textbf{414} & \textbf{105} & \textbf{764131} & \textbf{4736} & \textbf{39739} & \textbf{6762} & \textbf{60142} & \textbf{719655} & \textbf{77} & \textbf{99} & \textbf{90} & \textbf{97} \\ \hline
\multirow{12}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}Error \\ Seed.\end{tabular}}} & \multirow{6}{*}{\textbf{TtoN}} & \textbf{Chess} & 1268 & 14507 & 206 & 1639 & 35020 & 755 & 7693 & 2229 & 23839 & 26572 & 86 & 90 & 44 & 99 \\ \cline{3-17}
& & \textbf{Gantt} & 463 & 119182 & 108 & 830 & 681497 & 894 & 128952 & 1465 & 248964 & 551651 & 81 & 99 & 36 & 100 \\ \cline{3-17}
& & \textbf{iTrust} & 471 & 17601 & 32 & 353 & 1651963 & 4345 & 157587 & 4848 & 175541 & 1490031 & 94 & 98 & 57 & 100 \\ \cline{3-17}
& & \textbf{JHot.} & 779 & 35811 & 220 & 774 & 1070816 & 2691 & 84181 & 3690 & 120766 & 983944 & 78 & 98 & 50 & 99 \\ \cline{3-17}
& & \textbf{VOD} & 80 & 3490 & 20 & 246 & 20474 & 128 & 3444 & 228 & 7180 & 16902 & 80 & 93 & 25 & 99 \\ \cline{3-17}
& & \textbf{Avg.} & \textbf{612} & \textbf{38118} & \textbf{117} & \textbf{768} & \textbf{691954} & \textbf{1763} & \textbf{76371} & \textbf{2492} & \textbf{115258} & \textbf{613820} & \textbf{84} & \textbf{96} & \textbf{42} & \textbf{99} \\ \cline{2-17}
& \multirow{6}{*}{\textbf{NtoT}} & \textbf{Chess} & 3976 & 5077 & 8021 & 83 & 43003 & 5515 & 2351 & 17512 & 7511 & 35137 & 33 & 98 & 98 & 39 \\ \cline{3-17}
& & \textbf{Gantt} & 1483 & 32547 & 56213 & 102 & 711735 & 59556 & 37253 & 117252 & 69902 & 614926 & 3 & 100 & 94 & 37 \\ \cline{3-17}
& & \textbf{iTrust} & 1222 & 8406 & 14616 & 30 & 1646146 & 103464 & 48752 & 119302 & 57188 & 1493930 & 8 & 100 & 98 & 37 \\ \cline{3-17}
& & \textbf{JHot.} & 2130 & 13188 & 29385 & 65 & 1324432 & 79238 & 27047 & 110753 & 40300 & 1218147 & 7 & 100 & 97 & 31 \\ \cline{3-17}
& & \textbf{VOD} & 290 & 1681 & 1795 & 27 & 27147 & 1858 & 1715 & 3943 & 3423 & 23574 & 14 & 98 & 91 & 48 \\ \cline{3-17}
& & \textbf{Avg.} & \textbf{1820} & \textbf{12180} & \textbf{22006} & \textbf{61} & \textbf{750493} & \textbf{49926} & \textbf{23424} & \textbf{73752} & \textbf{35665} & \textbf{677143} & \textbf{13} & \textbf{99} & \textbf{96} & \textbf{38} \\ \hline
\end{tabular}
\end{table*}
\end{document}