无法显示表格的子标题

无法显示表格的子标题

每个人。

为了制作带有子标题的表格,我编写了如下所示的源代码。

但是,无法显示子字幕,如所附屏幕截图所示。

让我知道如何解决它。

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}

\begin{subtable}
\centering

\begin{tabular}{lll}
\hline
Land cover classes & Producer's accuracy(\%) & User's accuracy(\%)\\

\hline
UBA & 94 & 92 \\

OFA & 79 & 85 \\

FA & 88 & 81 \\

WA & 76 & 81 \\
Overall accuracy & 87 & \\
Kappa coefficient & 0.853 & \\
\hline
%\caption{1985}
\end{tabular}
\caption{1985}

\end{subtable}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{subtable}
\centering

\begin{tabular}{lll}
\hline
Land cover classes & Producer's accuracy(\%) & User's accuracy(\%)\\

\hline
UBA & 93 & 90 \\

OFA & 81 & 88 \\

FA & 83 & 80 \\

WA & 76 & 76 \\
Overall accuracy & 86 & \\
Kappa coefficient & 0.833 & \\
\hline
\end{tabular}

\caption{1997}

\end{subtable}
\caption{Summary of the results from the classification accuracy assessment conducted}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

在此处输入图片描述

答案1

您忘记指定widthfor subtable。应该是

\begin{subtable}{\textwidth}       %% change \textwidth suitably

在代码中更改这一点可以解决问题。

\documentclass{article}
\usepackage{subcaption}
\usepackage{booktabs}
\begin{document}
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}

\begin{subtable}{\textwidth}
\centering

\begin{tabular}{lll}
\toprule
Land cover classes & Producer's accuracy(\%) & User's accuracy(\%) \\ \midrule
UBA                & 94                      & 92                  \\
OFA                & 79                      & 85                  \\
FA                 & 88                      & 81                  \\
WA                 & 76                      & 81                  \\
Overall accuracy   & 87                      &                     \\
Kappa coefficient  & 0.853                   &                     \\
\bottomrule
%\caption{1985}
\end{tabular}
\caption{1985}

\end{subtable}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{subtable}{\textwidth}
\centering
\begin{tabular}{lll}
\toprule
Land cover classes & Producer's accuracy(\%) & User's accuracy(\%) \\ \midrule
UBA                & 93                      & 90                  \\
OFA                & 81                      & 88                  \\
FA                 & 83                      & 80                  \\
WA                 & 76                      & 76                  \\
Overall accuracy   & 86                      &                     \\
Kappa coefficient  & 0.833                   &                     \\
\bottomrule
\end{tabular}
\caption{1997}
\end{subtable}
\caption{Summary of the results from the classification accuracy assessment conducted}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}

在此处输入图片描述

我也已经将包中的\hlines 更改为etc。\toprulebooktabs

相关内容