【Latex】表格样例大全

本文详细介绍了如何使用LaTeX创建和定制表格,包括调整字号、控制行高以及依赖的包等内容,为 LaTeX 用户提供全面的表格样式参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1

在这里插入图片描述

% 所需包 \usepackage{type1cm}
\begin{table*}[t]
	\caption{Performance of MeFA (Adult). }
	\label{tab_1}
	\vskip 0.15in
	%\scriptsize
	\centering
	\fontsize{8}{12}\selectfont  %{字体尺寸}{行距}
	%\renewcommand\arraystretch{1.3}
	\begin{tabular}{!{\vrule width 1.0pt}c!{\vrule width 0.8pt}c|c|c|c|c|c|c|c!{\vrule width 1.0pt}}
		
		
		\specialrule{1.0pt}{0pt}{0pt}
		\textbf{{Algorithm}} &{XGB}&{DT}&LR-l1&LR-l2&SVM&DNN&RF &  \textbf{Average}\\\specialrule{1.0pt}{0pt}{0pt}
		
		%在第2列到第5列下面划
		
		% Mnist dataset 
		%\multicolumn{9}{!{\vrule width 1.0pt}c!{\vrule width 1.0pt}}{ \textbf{MNIST}} \\ \specialrule{1.0pt}{0pt}{0pt}
		
		{Training Accuracy} &86.74\%&87.46\%&85.64\%&85.47\%&85.17\%&87.84\% &100.0\%&\textbf{88.33}\%\\\hline
		
		{Testing Accuracy} &86.08\%&84.61\%&82.23\%&78.01\%&77.75\%&76.32\%&85.35\%&\textbf{81.48\%}\\\specialrule{1.0pt}{0pt}{0pt} \specialrule{1.0pt}{1pt}{0pt}
		
		\textbf{{Metric}}& \multicolumn{8}{c!{\vrule width 1.0pt}}{ \textbf{Authentication Precision}} \\ \specialrule{1.0pt}{0pt}{0pt}
		{Baseline-1} &0.0\%&100.0\%&0.0\%&0.0\%&100.0\%&100.0\%&0.0\%&\textbf{42.86\%}\\\hline
		
		{Baseline-2} &50.0\%&50.0\%&0.0\%&0.50\%&55.56\%&33.33\%&65.50\%&\textbf{43.06\%}\\\hline
		
		{MeFA}
		&100.0\%&50.0\%&100.0\%&100.0\%&100.0\%&50.0\%&100.0\%&\textbf{85.70\%} \\\specialrule{1.0pt}{0pt}{0pt} \specialrule{1.0pt}{1pt}{0pt}
		
		\textbf{{Metric}}& \multicolumn{8}{c!{\vrule width 1.0pt}}{ \textbf{Authentication Recall}} \\ \specialrule{1.0pt}{0pt}{0pt}
		{Baseline-1} &0.0\%&100.0\%&0.0\%&0.0\%&100.0\%&100.0\%&0.0\%&\textbf{42.86\%}\\\hline
		%{Authentication Accuracy} &100.0\%&100.0\%&100.0\%&100.0\%&100.0\%&100.0\%&80.0\%&\textbf{97.14\%}\\\hline
		
		{Baseline-2} &100.0\%&100.0\%&0.0\%&100.0\%&100.0\%&40.0\%&100.0\%&\textbf{77.14\%}\\\hline
		
		{MeFA}
		&100.0\%&100.0\%&100.0\%&100.0\%&100.0\%&100.0\%&100.0\%&\textbf{100.0\%} \\\specialrule{1.0pt}{0pt}{0pt}	
		
	\end{tabular}
	\centering
	\vskip -0.1in
\end{table*}

\fontsize{字号}{行距}
这个命令对其后所有文本都起作用,在使用此命令后需要用 \selectfont 才能使字体大小设置起作用。

2

在这里插入图片描述


\begin{table}
	\scriptsize
	\centering
	\renewcommand\arraystretch{1.2}
	% \fontsize{8}{15}\selectfont  %{字体尺寸}{行距}
	\begin{tabular}{!{\vrule width 1.0pt}c!{\vrule width 0.8pt}c|c||c|c!{\vrule width 1.0pt}}
		
		\specialrule{1.0pt}{0pt}{0pt}
		\multirow{3}{*}{Dataset}&\multicolumn{2}{c||}{Ours}&\multicolumn{2}{c!{\vrule width 1.0pt}}{ Merrer et al.} \\ \cline{2-5}
		&\shortstack{\emph{Authentication}\\\emph{Accuracy}} &\shortstack{\emph{Accuracy}\\\emph{Decline}} &\rule{0pt}{18pt} \shortstack{\emph{Authentication}\\\emph{Accuracy}} &\rule{0pt}{15pt}\shortstack{\emph{Accuracy}\\\emph{Decline}}\\ \specialrule{0.8pt}{0pt}{0pt}
		Adult&85.70\%&\diagbox[dir=SW]{}{}&100.0\%&0.41\% \\ \hline
		MNIST&94.29\%&\diagbox[dir=SW]{}{}&100.0\%&2.73\% \\ \hline
		Purchase50&100.0\%&\diagbox[dir=SW]{}{}&62.60\%&3.71\% \\ \hline
		Purchase100&100.0\%&\diagbox[dir=SW]{}{}&55.0\%&3.0\% \\ \specialrule{1.0pt}{0pt}{0pt}
		
	\end{tabular}
	
	\begin{tablenotes}
		\item[1]{ \hspace{50pt} No Accuracy Decline on Original Classification Task: \hspace{10pt}\diagbox[dir=SW]{}{}}
	\end{tablenotes}	
	
	\caption{Comparison of Ours and Merrer et al. for model authentication.}
	\label{compare_tab}
\end{table}

\rule[lift]{width}{height} 可以用来控制行高

例如:
\rule[0mm]{5mm}{10mm}%
\rule[-10mm]{5mm}{10mm}%
效果:
在这里插入图片描述

3

\begin{table*}
	\centering
	\caption{Comparison of different obfuscations in terms of their transformation capabilities}
	\begin{tabular}{llllll} % 控制表格的格式
		\toprule
		\multirow{2}{*}obfuscators & \multicolumn{5}{l}{Transformations}   \\
		\cline{2-6}  % 这部分是画一条横线在2-6 排之间
		&    Renaming & Dead code removal & control flow obfuscation & string encryption & code encryption \\
		\midrule
		Proguard &  \checkmark & $\times$  & $\times$ & \checkmark  & $\times$ \\
		Allatori & \checkmark & $\times$  & $\times$ & \checkmark  & $\times$ \\
		DashO & \checkmark & $\times$  & $\times$ & \checkmark  & $\times$ \\
		Androcrypt & \checkmark & $\times$  & $\times$ & \checkmark  & $\times$ \\
		\bottomrule
	\end{tabular}
	\label{tbl:table1}
\end{table*}

在这里插入图片描述

4

\begin{table}[tp]
	
\centering
\fontsize{7.5}{5}\selectfont
\begin{threeparttable}
\caption{Comparison of our approach with other 3 baseline defense methods (DP, Top1 and Top3) under 3 kinds of inference attacks. The attack accuracy reflects the robustness against data privacy leakage. Gradient attack does not apply to Top1 and Top3 defense methods since gradient inside the model is confidential in this scenario.}
\label{performance_comparison}
\begin{tabular}{ccccc}
	\toprule
	\multirow{3}{*}{\textbf{Dataset}}&\multirow{3}{*}{\shortstack{\textbf{Defense}\\\textbf{method}} }&\multicolumn{3}{c}{\textbf{Attack accuracy}}\cr
	\cmidrule(l){3-5} % 命令表格划横线
	&&Shadow attack&ML-Leaks&Gradient attack\cr
	\midrule
	\multirow{5}{*}{Adult}&No defense&0.52&0.52&0.625\cr
	&DP&0.50&0.50&0.609\cr
	&Top1&0.50&0.51&-\cr\
	&Top3&-&-&-\cr
	&\textbf{Ours}&0.50&0.50&0.574\cr\midrule
	
	\multirow{5}{*}{MNIST}&No defense&0.52&0.51&0.620\cr
	&DP&0.48&0.48&0.588\cr
	&Top1&0.46&0.39&-\cr\
	&Top3&0.49&0.49&-\cr
	&\textbf{Ours}&0.46&0.48&0.540\cr\midrule
	
	\multirow{5}{*}{Purchase20}&No defense&0.58&0.53&0.648\cr
	&DP&0.50&0.50&0.589\cr
	&Top1&0.50&0.48&-\cr\
	&Top3&0.53&0.51&-\cr
	&\textbf{Ours}&0.50&0.50&0.531\cr\midrule
	
	
	\multirow{5}{*}{CIFAR-10}&No defense&0.52&0.51&0.641\cr
	&DP&0.51&0.50&0.625\cr
	&Top1&0.49&0.49&-\cr\
	&Top3&0.52&0.51&-\cr
	&\textbf{Ours}&0.51&0.50&0.584\cr\midrule
	
	\multirow{5}{*}{FEMNIST}&No defense&0.55&0.53&0.643\cr
	&DP&0.48&0.46&0.605\cr
	&Top1&0.47&0.33&-\cr\
	&Top3&0.49&0.48&-\cr
	&\textbf{Ours}&0.47&0.46&0.582\cr
	
	
	\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}

在这里插入图片描述

5

这个表格需要以下两个包:

\usepackage{makecell} % 需要自己添加
\usepackage{color} % 需要自己添加
\begin{table*}[t]
	\centering
	\renewcommand{\arraystretch}{1.2} %默认是1.0
	\caption{Main Results}
	\label{table1}
	\begin{threeparttable}
	\begin{tabular}{c|c|cccc|cccc}
		\Xhline{1.2pt}
		
		\multicolumn{2}{c|}{\multirow{2}{*}{\textbf{Model Type}}} &\multicolumn{4}{c|}{\rule{0pt}{10pt}\textbf{CIFAR-10}} & \multicolumn{4}{c}{\textbf{ImageNet}}\\
		\cline{3-10}
		
		\multicolumn{2}{c|}{} & Acc & MTS \tnote{1} & DetRt \tnote{2} & \textbf{Infringe?} & Acc & MTS& DetRt & \textbf{Infringe?}  \\
		\Xhline{1.2pt}
		
		
		
		%0.25x-----------------
		\multirow{11}{*}{\makecell[c]{Positive\\ Suspect\\Model}} & Source Model &  &  &
		 &  \textbf{\textcolor{red}{Yes}}(5/5) &	  &&&\textbf{\textcolor{red}{Yes}}(5/5)	   \\
		\cline{2-10}
		
		& FTLL & 	& 	& 	& \textbf{\textcolor{red}{Yes}}(5/5)	& 	&&& \textbf{\textcolor{red}{Yes}}(5/5) \\
		\cline{2-10}
		
		& FTAL &	& 	& 	& \textbf{\textcolor{red}{Yes}}(5/5)	& 	&&& \textbf{\textcolor{red}{Yes}}(5/5)	\\
		\cline{2-10}
		
		& RTLL & 	& 	& 	& \textbf{\textcolor{red}{Yes}}(5/5)	& 	&&& \textbf{\textcolor{red}{Yes}}(5/5) \\
		\cline{2-10}
		
		& RTAL & 	& 	& 	& \textbf{\textcolor{red}{Yes}}(5/5)	& 	&&& \textbf{\textcolor{red}{Yes}}(5/5) \\
		\cline{2-10}
		
		 & Pruning 20\%  & 	& 	& 	& \textbf{\textcolor{red}{Yes}}(5/5)	&  &&& \textbf{\textcolor{red}{Yes}}(5/5)\\
		\cline{2-10}
		
		 & Pruning 40\%  & 	& 	& 	& \textbf{\textcolor{red}{Yes}}(5/5)	& &&& \textbf{\textcolor{red}{Yes}}(5/5) \\
		\cline{2-10}
		
		 & Pruning 60\% & 	& 	& 	& \textbf{\textcolor{red}{Yes}}(5/5)	&  &&& \textbf{\textcolor{red}{Yes}}(5/5) \\
		\cline{2-10}
		
		 & Adv-0.001 & 	& 	& 	& \textbf{\textcolor{red}{Yes}}(5/5)	& 	&&& \textbf{\textcolor{red}{Yes}}(5/5) \\
		\cline{2-10}
		
		 & Adv-0.01 & 	& 	& 	& \textbf{\textcolor{red}{Yes}}(5/5)	& 	&&& \textbf{\textcolor{red}{Yes}}(5/5) \\
		\cline{2-10}
		
		 & Adv-0.1 & 	& 	& 	& \textbf{\textcolor{red}{Yes}}(5/5)	&   &&& \textbf{\textcolor{red}{Yes}}(5/5) \\
		\cline{1-10}
		\multirow{4}{*}{\makecell[c]{Negative\\ Suspect\\Model}} & Category-1 &  &  &
		 &  \textbf{\textcolor{green}{No}}(0/5) &	  &&& \textbf{\textcolor{green}{No}}(0/5)	   \\
		\cline{2-10}
		
		& Category-2 & 	& 	& 	& \textbf{\textcolor{green}{No}}(0/5)	& 	&&& \textbf{\textcolor{green}{No}}(0/5) \\
		\cline{2-10}
		
		& Category-3 & 	& 	& 	& \textbf{\textcolor{green}{No}}(0/5)	& 	&&& \textbf{\textcolor{green}{No}}(0/5) \\
		\cline{2-10}
		
		& Category-4 & 	& 	& 	& \textbf{\textcolor{green}{No}}(0/5)	& 	&&& \textbf{\textcolor{green}{No}}(0/5) \\

		\Xhline{1.2pt}
	\end{tabular}
 	\end{threeparttable}
	\label{table_MAP}
	\begin{tablenotes}
		\footnotesize
		\item{1} MTS is the mean trajectory similarity.
		\item{2} DetRt is abbreviation of detection rate.
	\end{tablenotes}
\end{table*}

在这里插入图片描述

\begin{table}[H]
	%\scriptsize
	\fontsize{10}{10}
	\centering
	\renewcommand{\arraystretch}{1.2} %默认是1.0
	\caption{Comparison of different fingerprinting techniques. T1\%F denotes True Positive Rate when the False Positive Rate is at 1\%. For all three metrics, the higher the better.}
	\resizebox{1.0\linewidth}{!}{
\begin{threeparttable}
	\begin{tabular}{c|c|c|cccc}
		\Xhline{1.2pt}
		\multirow{2}{*}{\fontsize{10}{10}\textbf{Attack}}&\multirow{2}{*}{\fontsize{10}{10}\textbf{Dataset}}&\multirow{2}{*}{\fontsize{10}{10}\textbf{Acc}}&\multicolumn{4}{c}{\rule{0pt}{10pt}\fontsize{10}{10}\textbf{Fingerprint Detection Rate}}  \\ \cline{4-7}
		&&&IPGuard&CAE&UAP&Ours  \\ \cline{1-7}
		
		\multirow{2}{*}{\textbf{PRADA}} &CIFAR-10&$0.42$&$0.42$&$0.42$&$0.42$&$0.42$ \\ \cline{2-7}
		
		&ImageNet&$0.42$&$0.42$&$0.42$&$0.42$&$0.42$\\ \cline{1-7}
		
		\multirow{2}{*}{\textbf{Knockoff}} &CIFAR-10&$0.42$&$0.42$&$0.42$&$0.42$&$0.42$ \\ \cline{2-7}
		
		&ImageNet&$0.42$&$0.42$&$0.42$&$0.42$&$0.42$\\ \cline{1-7}
		\Xhline{1.2pt}
		
	\end{tabular}
\end{threeparttable}
}
	\label{table_small}
\end{table}

在这里插入图片描述

\begin{table}[H]
	%\scriptsize
	\fontsize{10}{10}
	\centering
	\renewcommand{\arraystretch}{1.2} %默认是1.0
	\caption{Comparison of different fingerprinting techniques. T1\%F denotes True Positive Rate when the False Positive Rate is at 1\%. For all three metrics, the higher the better.}
	\resizebox{1.0\linewidth}{!}{
		\begin{threeparttable}
			\begin{tabular}{p{1.1cm}|ccc|ccc|ccc}
				\Xhline{1.2pt}
				\multirow{2}{*}{\fontsize{10}{10}\textbf{Method}} &\multicolumn{3}{c|}{\rule{0pt}{10pt}\fontsize{10}{10}\textbf{CIFAR-10}} & \multicolumn{3}{c|}{\fontsize{10}{10}\textbf{CIFAR-100}}& \multicolumn{3}{c}{\fontsize{10}{10}\textbf{ImageNet}}\\
				\cline{2-10}
				
				&T1\%F&T10\%F&AUC&T1\%F&T10\%F&AUC&T1\%F&T10\%F&AUC\\ \cline{1-10}
				
				IPGuard&$0.28$&$0.42$&$0.63$&$0.30$&$0.46$&$0.67$&$0.18$&$0.27$&$0.59$ \\ \cline{1-10}
				
				CAE &$0.52$&$0.64$&$0.75$&$0.53$&$0.67$&$0.78$&$0.39$&$0.43$&$0.76$ \\ \cline{1-10}
				
				UAP &$0.76$&$0.78$&$0.91$&$0.77$&$0.83$&$0.92$&$0.37$&$0.52$&$0.85$ \\ \cline{1-10}
				
				\textbf{Ours} &$\textbf{1.00}$&$\textbf{1.00}$&$\textbf{1.00}$&$\textbf{1.00}$&$\textbf{1.00}$&$\textbf{1.00}$&$\textbf{0.88}$&$\textbf{0.90}$&$\textbf{0.96}$ \\ 
				
				\Xhline{1.2pt}
				
			\end{tabular}
		\end{threeparttable}
	}
	\label{table_small}
\end{table}

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

学渣渣渣渣渣

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值