在表格下方添加注释

在表格下方添加注释

我想在表格下方添加一条注释。我参考了以下链接:在表格下添加注释.但给出的代码:

\documentclass{article}
\usepackage{booktabs,caption,fixltx2e}
\usepackage[flushleft]{threeparttable}
\begin{document}

\begin{table}
  \begin{threeparttable}
    \caption{Sample ANOVA table}
     \begin{tabular}{lllll}
      \toprule
        Stubhead & \( df \) & \( f \) & \( \eta \) & \( p \) \          \midrule
        & \multicolumn{4}{c}{Spanning text} \            Row 1 & 1 & 0.67 & 0.55 & 0.41 \            Row 2 & 2 & 0.02 & 0.01 & 0.39 \            Row 3 & 3 & 0.15 & 0.33 & 0.34 \            Row 4 & 4 & 1.00 & 0.76 & 0.54 \          \bottomrule
    \end{tabular}
    \begin{tablenotes}
      \small
      \item This is where authors provide additional information about
      the data, including whatever notes are needed.
    \end{tablenotes}
  \end{threeparttable}
\end{table}
\end{document}

不起作用(它无法编译并给出 42 个错误)。我想要实现类似这样的表格:

在此处输入图片描述

答案1

这是一个可能的解决方案。

在此处输入图片描述

代码

\documentclass[border=10pt]{standalone}
\usepackage{array}
\usepackage{threeparttable}
\begin{document}
\newcolumntype{C}{>{\centering\arraybackslash}m{0.25\linewidth}}
\newcolumntype{L}{>{\centering\arraybackslash}m{0.15\linewidth}}
%\begin{table}
  \begin{threeparttable}
    \caption{Sample ANOVA table}
     \begin{tabular}{|*{3}{C|}{*{2}{L|}}}\hline
Course &  Institution/ School  & Board/University  &  Years of  passing  & Aggregate  \\ \hline 
B.Tech.,  Electrical  \&  Electronics 
Engineering & Pondicherry  Engineering College  Puducherry & Pondicherry  University& 2010  pursuing & $8.42^\star$ \\     \hline
Higher  secondary  &  St.Joseph Of Cluny  H.S.S.  Punducherry & TamiNadu Board of 
Higher Secondary  Education & 2006  & 93.375\% \\   \hline         
Matriculation  &  St.Joseph Of  Cluny  H.S.S.   Punducherry & TamiNadu Board of 
Secondary Education &2004 & 92.456\% \\ \hline
    \end{tabular}
    \begin{tablenotes}
      \small
      \item  \textbf{${}^\star$ Cumulative grade point average up to $6^{th}$ semester}.
    \end{tablenotes}
  \end{threeparttable}
%\end{table}
\end{document}

答案2

您尝试使用单个反斜杠来开始新行,但这是错误的,应该是双反斜杠\\

\documentclass{article}
\usepackage{booktabs,caption,fixltx2e}
\usepackage[flushleft]{threeparttable}
\begin{document}

\begin{table}
  \begin{threeparttable}
    \caption{Sample ANOVA table}
     \begin{tabular}{lllll}
      \toprule
        Stubhead & \( df \) & \( f \) & \( \eta \) & \( p \) \\  \midrule
        & \multicolumn{4}{c}{Spanning text} \\
        Row 1 & 1 & 0.67 & 0.55 & 0.41 \\
        Row 2 & 2 & 0.02 & 0.01 & 0.39 \\
        Row 3 & 3 & 0.15 & 0.33 & 0.34 \\           
        Row 4 & 4 & 1.00 & 0.76 & 0.54 \\
      \bottomrule
    \end{tabular}
    \begin{tablenotes}
      \small
      \item This is where authors provide additional information about
      the data, including whatever notes are needed.
    \end{tablenotes}
  \end{threeparttable}
\end{table}
\end{document}

相关内容