如何将表格编号和标题放在不同的行上?

如何将表格编号和标题放在不同的行上?

我有一张这样的桌子:

\documentclass[]{article}
\usepackage{booktabs}

\begin{document}

\begin{table}[!htb]
\centering
\caption{}
\label{AUC Interpretation}
\begin{tabular}{@{}lcc@{}}
\toprule
\multicolumn{1}{c}{\textbf{AUC}}                                                       
& \textbf{\begin{tabular}[c]{@{}c@{}}Interpretation\end{tabular}}  \\ 
\midrule
\begin{tabular}[c]{@{}l@{}}.50\end{tabular} & Chance   \\ \midrule
\begin{tabular}[c]{@{}l@{}}.70\end{tabular} & Acceptable \\ \midrule
\begin{tabular}[c]{@{}l@{}}.75\end{tabular} & Large      \\ \midrule
\begin{tabular}[c]{@{}l@{}}.80\end{tabular} & Excellent  \\ \midrule
\begin{tabular}[c]{@{}l@{}}.90 and higher\end{tabular} & Outstanding               
\\ \bottomrule
\end{tabular}
\end{table}

\end{document}

IE, 在此处输入图片描述

我如何才能让标题和表号像这样放在不同的行上:在此处输入图片描述

答案1

您可以使用caption包来实现这一点。嵌套表格不是必需的。

\documentclass{article}
\usepackage{booktabs}
\usepackage{caption}

\captionsetup[table]{
  labelsep=newline,
  justification=justified,
  singlelinecheck=false,
  textfont=it,
}

\begin{document}

\begin{table}[!htb]
  \centering
  \caption{AUC Interpretation}
  \label{tab:auc-interpretation}
  \begin{tabular}{@{}lc@{}}
    \toprule
    \multicolumn{1}{c}{\textbf{AUC}} & \textbf{Interpretation} \\
    \midrule
    .50                              & Chance                  \\
    \midrule
    .70                              & Acceptable              \\
    \midrule
    .75                              & Large                   \\
    \midrule
    .80                              & Excellent               \\
    \midrule
    .90 and higher                   & Outstanding             \\
    \bottomrule
  \end{tabular}
\end{table}

\end{document}

在此处输入图片描述

相关内容