Latex: 表格内换行

遇到表格内容太长,需要换行。需要用到 makecell 指令就可以轻松实现。

首先,需要宏包:

\usepackage{makecell}

然后,主要要在 tabular 里面使用。

其次,用法是:

\makecell[居中情况]{第1行内容 \\ 第2行内容 \\ 第3行内容 ...}

也就是说,只需要在换行的地方键入 \\ 即可实现。[居中情况] 包括 r,c,l,分别表示靠右、居中、靠左。

 

下面看一个完整的例子,轻松学会:

\begin{table*}[!t]
    %\setlength{\abovecaptionskip}{-8pt}
    \caption{Performance comparisons in terms of average PSNR, SSIM, FSIMc, CNI evaluations on five synthetic databases.}\label{tab:experiment_synthetic}
    \centering
    %\begin{small}%\rowcolor{cyan!10}
    \begin{tabular}{rlrrrrrrrrrrrrr}
        \toprule [1pt]
        & &\multicolumn{2}{c}{Prior-based} &\multicolumn{6}{c}{Supervised Learning} & \multicolumn{2}{c}{\makecell[c]{Semi-Supervised \\ Learning}}  &\multicolumn{3}{c}{\makecell[c]{Unsupervised Learning}}\\
        \cmidrule(r){1-2}  \cmidrule(rl){3-4} \cmidrule(rl){5-10} \cmidrule(rl){11-12} \cmidrule(l){13-15}
        \textbf{Database} & \textbf{Metric} & \textbf{DCP} &\textbf{NLD} & \textbf{DHN} & \textbf{MSCNN} & \textbf{EPDN} & \textbf{GridDN} & \textbf{MSBDN} & \textbf{FFANet} & \textbf{DADN} & \textbf{SSDN}  & \textbf{DDCP} & \textbf{ZID} &  \textbf{Our Model}\\
        \bottomrule [1pt]
    \end{tabular}
\end{table*}

效果:

 

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值