\begin{table}[htbp] %[htbp]用来设置图表放置的位置
\caption{Scan Data}
\setlength{\tabcolsep}{0.5mm} %用来设置列间的距离
\begin{tabular}{cccc} %{cccc}每一列居中显示
\toprule
Port & Protocol & Number of device fingerprints & Storage capacity on hard disk (g) \\
\midrule
21 & FTP & 17,488,151 & 2.65 \\
22 & SSH & 6,875,052 & 0.78\\
25 & SMTP & 16,471,586 & 2.53\\
\textcolor{red}{80} & \textcolor{red}{HTTP} & \textcolor{red}{65,564,171} & \textcolor{red}{392}\\ %textcolor给字体加颜色,需要加入\usepackage{color}
110 & POP3 & 46,316,650 & 5.25\\
143 & IMAP & 20,165,146 & 2.29\\
\textcolor{red}{443} & \textcolor{red}{HTTPS} & \textcolor{red}{53,324,611} & \textcolor{red}{397}\\
502 & MODBUS & 19,865,183 & 2.24\\
995 & POP3S & 19,429,514 & 2.23\\
\bottomrule
\end{tabular}
\end{table}
\begin{algorithm}[htpb!]
\caption{Dynamic multilevel cache algorithm}
\label{skyline}
\quad {\bfseries input}: {\emph {NVD\_CVE, ip\_banner\_cpe}}\\
\label{}
\ \ \ {\bfseries output}: {\emph {ip\_cves}}\\
1: {\bfseries BEGIN} \\
2:\quad def constructFastPool:\\
3:\qquad N = 1000\\
4:\qquad fastPool = []\\
5:\qquad tempList = sorted(ip\_banner\_cpe, N)\\
6:\qquad List = tag(count(tempList) $*$ 40\%)\\
7:\qquad for i in List:
8:\qquad \quad if ip\_banner\_cpe == nvd\_cpe:\\
9:\qquad \qquad fastPool.add(nvd\_cve)\\
10:\quad main():\\
11:\qquad for i in ip\_banner\_cpe:\\
12:\qquad \quad constructFastPool(ip\_banner\_cpe, N)\\
13:\qquad \quad if i in fastPool:\\
14:\qquad \qquad ip\_cves.add(nvd\_cpe)\\
15:\qquad \quad else:\\
16:\qquad \qquad ip\_cves.add(i.searchInNVD)\\
17:{\bfseries END}
\end{algorithm}
\begin{figure}[htb]
\center{\includegraphics[width=8cm,height=4cm] {fig3.png}} %设置图片显示的宽度长度,以及图片的位置
\caption{\label{1} Three tools scan the number of surviving IP for 80 ports}
\end{figure}
\begin{table}[htbp]
\centering
\caption{Equation}
\setlength{\tabcolsep}{1.0mm}
\newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
\begin{tabular}{|c|c|l|}
\hline
% after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
Accuracy & Precision=TP$/$(TP$+$FP) & \tabincell {l} {TP: The number of CVE \\ detected by Shodan \\ and the framework \\ proposed in this paper \\finds the exact \\match of CVE.
\\ FP: The number of CVEs \\ detected by Shodan \\ but not found \\ in the framework\\ presented in this paper.}\\
\hline
Time efficiency & $\sum_{i=1}^{n} t_{i}$ & \tabincell {l} {t: find the total time \\ spent on all sample data.\\
T: The time it takes to \\scan 1000 IPs per \\set of experiments.}\\
\hline
\end{tabular}
\end{table}
不知道为啥起作用,但是这样写确实可以:
(1)加入 \newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
(2)每一个要分段的地方 \tabincell {l} {text},其中{l}是让分段后的数据靠左显示,根据具体需求修改,{text}里面中text需要分段的地方加上 \
(2)每一个要分段的地方 \tabincell {l} {text},其中{l}是让分段后的数据靠左显示,根据具体需求修改,{text}里面中text需要分段的地方加上 \