从 \multicolumn 左侧开始

从 \multicolumn 左侧开始

我有一张带有脚注的表格,如下所示:

在此处输入图片描述

我想从左边开始,就像这样Year_month。我的代码如下:The dependent* p < 0.1

\bottomrule
        \multicolumn{5}{@{}l@{}}{\footnotesize\shortstack{ $^{*}\, p<0.1$; $^{**}\, p<0.05$; $^{***}\, p<0.01$. 
\cite{white1980heteroskedasticity} robust SEs in parentheses clustered on a district level.  \\
Year\textunderscore month dummy, weekday \& holidays dummy and district dummy. \\
The dependent variable is the number of robberies per 1.000.000 population.}} \\
\end{tabular}

请问我该怎么做?

答案1

根据有根据的猜测,文本宽度的 80% 足以容纳脚注。

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

\begin{document}

\begin{table}[htp]
\centering

\caption{A table caption explaining what it's about}

\begin{tabular*}{0.8\textwidth}{@{\extracolsep{\fill}} l c c c c @{}}
\toprule
N & 451185 & 451185 & 451185 & 451185 \\
Pseudo $\mathrm R^2$ & 0.01 & 0.01 & 0.01 & 0.01\\
\midrule[\heavyrulewidth]
\end{tabular*}

\begin{minipage}[t]{0.8\textwidth}\footnotesize
  $^{*}$ $p<0.1$; $^{**}$ $p<0.05$; $^{***}$ $p<0.01$.

  \cite{white1980heteroskedasticity} robust SEs in parentheses clustered on a district level.

  Year\textunderscore month dummy, weekday \& holidays dummy and district dummy.

  The dependent variable is the number of robberies per 1\,000\,000 population.
\end{minipage}

\end{table}
\end{document}

在此处输入图片描述

再多做一些工作我们就可以让两个部分的宽度完全相同。

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

\newsavebox{\tablefootnotebox}

\begin{document}

\begin{table}[htp]
\centering

\caption{A table caption explaining what it's about}

% we set the footnotes
\sbox{\tablefootnotebox}{%
  \footnotesize
  \begin{tabular}[t]{@{}l@{}}
  $^{*}$ $p<0.1$; $^{**}$ $p<0.05$; $^{***}$ $p<0.01$.\\
  \cite{white1980heteroskedasticity} robust SEs in parentheses clustered on a district level.\\
  Year\textunderscore month dummy, weekday \& holidays dummy and district dummy.\\
  The dependent variable is the number of robberies per 1\,000\,000 population.
  \end{tabular}%
}

\begin{tabular*}{\wd\tablefootnotebox}{@{\extracolsep{\fill}} l c c c c @{}}
\toprule
N & 451185 & 451185 & 451185 & 451185 \\
Pseudo $\mathrm R^2$ & 0.01 & 0.01 & 0.01 & 0.01\\
\midrule[\heavyrulewidth]
\end{tabular*}

\usebox{\tablefootnotebox}

\end{table}

\end{document}

在此处输入图片描述

答案2

您还可以使用该makecell包:

    \documentclass{article}
    \usepackage{array,booktabs}
    \usepackage{makecell}

    \begin{document}

    \begin{tabular}{p{6em}*{4}{c}}
    \toprule
    N & 451185 & 451185 & 451185 & 451185 \\
    Pseudo $\mathrm R^2$ & 0.01 & 0.01 & 0.01 & 0.01\\
    \bottomrule\addlinespace[2pt]
    \multicolumn{5}{@{}l@{}}{\footnotesize
    \makecell[l]{$^{*}\, p<0.1$; $^{**}\, p<0.05$; $^{***}\, p<0.01$.
    \cite{white1980heteroskedasticity} robust SEs in parentheses clustered on a district level.\\
    Year\textunderscore month dummy, weekday \& holidays dummy and district dummy.\\
    The dependent variable is the number of robberies per 1.000.000 population.}}
    \end{tabular}

    \end{document} 

在此处输入图片描述

答案3

我认为使用三个单独的\multicolumn指令没有什么问题。

在此处输入图片描述

\documentclass{article} 
\usepackage[T1]{fontenc}
\usepackage{array,booktabs}
\begin{document}
\begin{tabular}{@{}p{\textwidth}@{}}
\bottomrule
\multicolumn{1}{@{}l@{}}{\footnotesize 
$^{*}\, p<0.1$; $^{**}\, p<0.05$; $^{***}\, p<0.01$. 
\cite{white1980heteroskedasticity} robust SEs in parentheses clustered on a district level.}\\
\multicolumn{1}{@{}l@{}}{\footnotesize
Year\textunderscore month dummy, weekday \& holidays dummy and district dummy.}\\
\multicolumn{1}{@{}l@{}}{\footnotesize
The dependent variable is the number of robberies per 1.000.000 population.} \\
\end{tabular}
\end{document}
    

相关内容