我正在尝试在文档中间添加两个表格

我正在尝试在文档中间添加两个表格

第一个表格很好(因为我已将其添加到第 2 页),而表格 2 和 3,我想将它们添加到第 5 页左右。它们的​​代码也相同,但它们显示在文档末尾,并且有间隙。我已将 [t] 用于页面顶部。我甚至在文档开头移动了代码,但仍然显示在末尾。对于第一个表格来说效果很好,但对于第二个表格则不然。

代码:

\begin{table*}[t]
\centering
\caption{Directed Graph}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|} \hline
Name&Nodes&Edges&k=1(time)&k=1($\%$ ratio)&k=10(time)&k=10($\%$ ratio)&k=100(time)&k=100($\%$ ratio)\\ \hline

Core-Citation& 23166& 91500&0.701 &0.0103 &1.035 &0.017 &2.300 &0.0327  \\ \hline

HEP-TH & 27710 & 352807 &4.355 &0.0231 &8.0834 &0.04655 &12.833&0.0747  \\ \hline

Slashdot& 82168& 948464&1.927 &0.0001 &9.586 &0.0071 &54.232 &0.0449  \\ \hline

Web-Stanford& 281903 &2312497 & 973.69& 0.065&1631.48 &0.106 &2013.64 &0.106  \\ \hline


Youtube Links&1138499 &4942297 &200.23 &0.0014 &583.22 &0.0050 &1034.674 & 0.00811\\

\hline\end{tabular}
\end{table*}

\begin{table*}
\centering
\caption{Un-Directed Graph}
\begin{tabular}{|c|c|c|c|c|c|c|c|c|} \hline
Name&Nodes&Edges&k=1(time)&k=1($\%$ ratio)&k=10(time)&k=10($\%$ ratio)&k=100(time)&k=100($\%$ ratio)\\ \hline

COND-MAT&23133 &93497 &0.6701 &0.0024 &1.541 &0.0109 &5.618 &0.0591 \\ \hline

Email-Enron&36692 &183831 &0.423 &0.0010 &0.743 &0.0028 &4.6102 &0.0238 \\ \hline

Brightkite&58228 &214078 &10.1704 &0.024 &10.145 &10.170 &13.202 &0.0291 \\ \hline

Amazon(MDS)&334863 &925872 &2.968 &0.0000831 &3.190 &0.0000855 &3.711 &0.0000978 \\ \hline


Hyves&1402673 &2777419 &3119.21 &0.0132 & 4229.20 & 0.0136& 4772.69 &0.01490 \\

\hline\end{tabular}
\end{table*}

答案1

我建议您将两个tabular环境及其相关\caption语句放在一个table环境中。我还鼓励您 (a) 为表格标题提供更多结构,以及 (b) 通过删除所有垂直线和大多数水平线使表格看起来更“开放”。

在此处输入图片描述

\documentclass{article}
\usepackage[letterpaper,margin=1in]{geometry} % set page parameters
\usepackage{booktabs,caption}
\captionsetup{skip=0.333\baselineskip}
\begin{document}
\begin{table*}
\centering
\caption{Directed Graph}
\begin{tabular}{@{}lrr*{6}{c}@{}} 
\toprule
Name&Nodes&Edges&
\multicolumn{2}{c}{$k=1$} & \multicolumn{2}{c}{$k=10$} & \multicolumn{2}{c@{}}{$k=100$} \\
\cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(l){8-9} 
&&& time & \% ratio & time & \% ratio & time & \% ratio \\ 
\midrule
Core-Citation& 23166& 91500&0.701 &0.0103 &1.035 &0.017 &2.300 &0.0327  \\     
HEP-TH & 27710 & 352807 &4.355 &0.0231 &8.0834 &0.04655 &12.833&0.0747  \\     
Slashdot& 82168& 948464&1.927 &0.0001 &9.586 &0.0071 &54.232 &0.0449  \\     
Web-Stanford& 281903 &2312497 & 973.69& 0.065&1631.48 &0.106 &2013.64 &0.106  \\        
Youtube Links&1138499 &4942297 &200.23 &0.0014 &583.22 &0.0050 &1034.674 & 0.00811\\
\bottomrule
\end{tabular}

\bigskip\bigskip  % some vertical whitespace between the tabulars

\caption{Un-Directed Graph}
\begin{tabular}{@{}lrr*{6}{c}@{}} 
\toprule
Name&Nodes&Edges&
\multicolumn{2}{c}{$k=1$} & \multicolumn{2}{c}{$k=10$} & \multicolumn{2}{c@{}}{$k=100$} \\
\cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(l){8-9} 
&&& time & \% ratio & time & \% ratio & time & \% ratio \\ 
\midrule
COND-MAT&23133 &93497 &0.6701 &0.0024 &1.541 &0.0109 &5.618 &0.0591 \\   
Email-Enron&36692 &183831 &0.423 &0.0010 &0.743 &0.0028 &4.6102 &0.0238 \\     
Brightkite&58228 &214078 &10.1704 &0.024 &10.145 &10.170 &13.202 &0.0291 \\    
Amazon(MDS)&334863 &925872 &2.968 &0.0000831 &3.190 &0.0000855 &3.711 &0.0000978 \\  
Hyves&1402673 &2777419 &3119.21 &0.0132 & 4229.20 & 0.0136& 4772.69 &0.01490 \\
\bottomrule
\end{tabular}
\end{table*}

\end{document}

相关内容