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*}

效果:

猜你喜欢

转载自blog.csdn.net/u014546828/article/details/116043779
今日推荐