Latex画三线格

四、Latex画三线格

首先导入\usepackage{booktabs}包,具体使用如下:

\begin{table*}[!t]
% increase table row spacing, adjust to taste
\renewcommand{\arraystretch}{1.3}
\caption{An Example of three line Table}
\label{table_3}
\centering
\begin{tabular}{llll}
\toprule
%A & N=3 1 &N=5 & N=7 & N=9 \\
%Loss function & Steg-img PSNR(db) & Deco-img PSNR(db) & Steg-img SSIM & Deco-img SSIM \\
Database &Basic model & Antique's model & Our model  \\
\midrule
ImageNet &0.831 &0.806 &0.789   \\
COCO &0.795 &0.769 &0.746 \\
\bottomrule
\end{tabular}
\end{table*}

结果如下:
在这里插入图片描述
如果觉得表格长度不符合,可以自己调整。
表格太短:
\setlength{\tabcolsep}{7mm}{XXXX} ,调整表格宽度, 效果为”按页面宽度调整表格”。7mm可以自己根据表格调整,一直到文档宽度。

\begin{table*}[h]
% increase table row spacing, adjust to taste
\renewcommand{\arraystretch}{1.3}
\caption{An Example of three line Table}
\label{table_3}
\centering
\setlength{\tabcolsep}{10mm}{
\begin{tabular}{llll}
\toprule
%A & N=3 1 &N=5 & N=7 & N=9 \\
%Loss function & Steg-img PSNR(db) & Deco-img PSNR(db) & Steg-img SSIM & Deco-img SSIM \\
Database &Basic model & Antique's model & Our model  \\
\midrule

ImageNet &0.831 &0.806 &0.789   \\

COCO &0.795 &0.769 &0.746 \\

\bottomrule
\end{tabular}}
\end{table*}

效果如下:
在这里插入图片描述

2.表格过宽

\resizebox{\textwidth}{15mm}{XXXX} ,根据表格内容自动调整表格宽度。
{15mm}是可以根据自己文章和表格来调整的。

\begin{table}[!t]
% increase table row spacing, adjust to taste
%\renewcommand{\arraystretch}{1.3}
\textbf{Table 2}~~PSNR and SSIM of steganography and decoded information\\
\label{table_1}
\centering
\setlength{\tabcolsep}{1.2mm}{
\begin{tabular}{lllll}
\toprule
Loss function &\tabincell{c}{Steg-img\\PSNR(db)}  &\tabincell{c}{Deco-img\\PSNR(db)} &\tabincell{c}{Steg-img\\SSIM} &\tabincell{c}{Deco-img\\SSIM} \\
\midrule
MSE & 27.97 & 26.30 &0.8592 &0.8301  \\
SSIM &  1.0000 &1.0000 &1.0000 &1.0000  \\
MSE+SSIM &7.2632 &14.3913 &21.0323 &27.3171 \\
\bottomrule
\end{tabular}}
\end{table}

tabincell是表格内换行的命令,自定义的,需在文章前添加 \newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}}
效果:
在这里插入图片描述其中第二个表格是正常的,第一个是调整后的表格。

  • 1
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

storm岚

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

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

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

打赏作者

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

抵扣说明:

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

余额充值