表格末尾的注释

表格末尾的注释

我想在下表中添加一些小注释,但它超出了范围。

\begin{table}[H] 
\centering
    \setlength{\arrayrulewidth}{1mm}
    \renewcommand{\arraystretch}{0.65}

    \begin{tabular}{lllllll}
    \hline
    Variable& Min & 1st Qu. & Median & Mean & 3rd Qu. & Max \\ \hline
        loan amnt & 500 & 8000 & 13000 & 14760 & 20000 & 35000\\
        int rate & 0.0532 & 0.0999& 0.1299 & 0.1324 & 0.1620 & 0.2899\\
        credit grade & 1.00 & 4.00 & 5.00 & 5.203 & 6.00 & 7.00 \\
        sub grade1 & 1.00 & 7.00 & 11.00 & 11.95 & 16.00 & 35.00 \\

        \hline
    \end{tabular}
    \multicolumn{5}{@{}l}{\tiny Notes: Credit Grade is the grade assigned by the Lending Club based on the FICOrano credit rating information along with other information. Credit Grade ‘1’ is the loan category of ....} \\

    \caption{Descriptive statistics for some of the variables}
    \label{tab:my_label}
\end{table}

答案1

使用threeparttable。这是一个可能的代码,但你真的想要那个结果吗?

\documentclass{article}%
\usepackage{threeparttable, array, float}

\begin{document}

\begin{table}[H]
\centering
    \setlength{\arrayrulewidth}{1mm}
    \renewcommand{\arraystretch}{0.65}
\begin{threeparttable}
    \begin{tabular}{*{7}{l}}
    \hline
    Variable& Min & 1st Qu. & Median & Mean & 3rd Qu. & Max \\ \hline
        loan amnt & 500 & 8000 & 13000 & 14760 & 20000 & 35000\\
        int rate & 0.0532 & 0.0999& 0.1299 & 0.1324 & 0.1620 & 0.2899\\
        credit grade & 1.00 & 4.00 & 5.00 & 5.203 & 6.00 & 7.00 \\
        sub grade1 & 1.00 & 7.00 & 11.00 & 11.95 & 16.00 & 35.00 \\
        \hline
    \end{tabular}
  \begin{tablenotes}[online, flushleft]
  \tiny
   \item[]Notes: Credit Grade is the grade assigned by the Lending Club based on the FICOrano credit rating information along with other information. Credit Grade ‘1’ is the loan category of ....
  \end{tablenotes}
    \caption{Descriptive statistics for some of the variables}
    \label{tab:my_label}
\end{threeparttable}
\end{table}

\end{document} 

在此处输入图片描述

我建议使用这个代码,在我看来,它会产生一个更漂亮的表格(加载booktabs):

\begin{table}[H]
    \centering
    \begin{threeparttable}
        \begin{tabular}{*{7}{l}}
        \toprule[1.2pt]
        Variable& Min & 1st Qu. & Median & Mean & 3rd Qu. & Max \\ 
        \cmidrule[0.8pt](lr){1-7}
            loan amnt & 500 & 8000 & 13000 & 14760 & 20000 & 35000\\
            int rate & 0.0532 & 0.0999& 0.1299 & 0.1324 & 0.1620 & 0.2899\\
            credit grade & 1.00 & 4.00 & 5.00 & 5.203 & 6.00 & 7.00 \\
            sub grade1 & 1.00 & 7.00 & 11.00 & 11.95 & 16.00 & 35.00 \\
            \midrule[1.2pt]
        \end{tabular}
      \begin{tablenotes}[online, flushleft]
      \footnotesize%\smallskip
       \item[]\hspace*{-\fontdimen2\font}Notes: Credit Grade is the grade assigned by the Lending Club based on the FICOrano credit rating information along with other information. Credit Grade ‘1’ is the loan category of ....
      \end{tablenotes}
        \caption{Descriptive statistics for some of the variables}
        \label{tab:my_label}
    \end{threeparttable}
    \end{table}

在此处输入图片描述

答案2

这是用于启用换行的 MWE \multicolumn{3}{|p{10cm}|}{...}。您可以根据需要调整宽度。

代码:

\documentclass{article}

\usepackage{multicol}

\begin{document}

\begin{tabular}{|c|c|c|}
    \hline
    foo & bar & foobar\\ \hline
    \multicolumn{3}{|p{10cm}|}{\tiny Notes: Credit Grade is the grade assigned by the Lending Club based on the FICOrano credit rating information along with other information. Credit Grade ‘1’ is the loan category of ....}\\ \hline
\end{tabular}

\end{document}

结果:

在此处输入图片描述

相关内容