【Latex】表格样例大全

本文档详细介绍了如何使用 LaTeX 进行表格样式设置,包括字号与行距调整、行高控制等关键技巧,是 LaTeX 用户制作表格的必备参考资料。
摘要由CSDN通过智能技术生成

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}

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

一起来学深度学习鸭

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

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

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

打赏作者

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

抵扣说明:

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

余额充值