表格编号和说明

表格编号和说明

我正在尝试向下表添加表号、表标题和表描述(该表由@leandriis 和@Dynamite 根据有用的输入构建)

\documentclass[final,3p,times,12pt]{elsarticle}


\usepackage{booktabs}
\begin{document}
%\begin{landscape}
\noindent{\small \setlength{\tabcolsep}{4pt}
\begin{tabular}{@{}lcccccc@{}} 
\toprule
& \multicolumn{6}{c}{Dependent Variable: Y}\\
\cmidrule{2-7}
& \multicolumn{3}{c}{City-State Level} & \multicolumn{3}{c}{State-Level}\\
\cmidrule(r){2-4} \cmidrule(l){5-7}
 & (1) & (2) & (3) & (4) & (5) & (6) \\
\midrule
 &  &  &  &  &  &  \\
X & 0.198*** & 0.216*** & 0.141*** & 0.324*** & 0.305*** & 0.189*** \\
 & (0.0472) & (0.0399) & (0.0394) & (0.0456) & (0.0407) & (0.0374) \\ \addlinespace
X2 & 0.153** & 0.281*** & 0.282*** & 0.353*** & 0.518*** & 0.448*** \\
 & (0.0632) & (0.0627) & (0.0592) & (0.0854) & (0.0834) & (0.0718) \\ \addlinespace
X3 & 0.0577 & -0.0426 & -0.0985* & 0.0102 & -0.133* & -0.158** \\
 & (0.0555) & (0.0519) & (0.0508) & (0.0715) & (0.0693) & (0.0628) \\ \addlinespace
Number of Nonstop  &  &  & -0.0105*** &  &  & -0.00816** \\
Carriers &  &  & (0.00262) &  &  & (0.00350) \\ \addlinespace
Bus Indicator &  &  & -0.118*** &  &  & -0.148*** \\
 &  &  & (0.00936) &  &  & (0.0137) \\ \addlinespace
Other PMS Indicator &  &  & -0.0589*** &  &  & -0.0982*** \\
 &  &  & (0.00743) &  &  & (0.0101) \\ \addlinespace
Share of Passengers Traveling  &  &  & 0.129*** &  &  & 0.177*** \\
Connect, City-Level &  &  & (0.0173) &  &  & (0.0192) \\ \addlinespace
Share of Passengers Traveling  &  &  & 0.104*** &  &  & 0 \\
Connect &  &  & (0.0139) &  &  & (5.35e-09) \\ \addlinespace
Log(Population) &  &  & 0.304*** &  &  & 0.341*** \\
 &  &  & (0.106) &  &  & (0.122) \\ \addlinespace
Log(Income Per Capita) &  &  & 0.373*** &  &  & 0.318*** \\
 &  &  & (0.102) &  &  & (0.109) \\ \addlinespace
Constant & 5.043*** & 6.100*** & 5.545*** & 4.936*** & 0.636 & 2.836*** \\
 & (0.0203) & (0.249) & (0.447) & (0.0279) & (0.586) & (0.669) \\ \addlinespace
 &  &  &  &  &  &  \\
Observations & 1,237,878 & 1,237,878 & 1,209,791 & 262,534 & 262,534 & 255,173 \\
R-squared & 0.821 & 0.826 & 0.836 & 0.852 & 0.861 & 0.876 \\
Number of city-state pairs & 46510 & 46510 & 45244 &  &  &  \\
 Number of cities &  &  &  & 7190 & 7190 & 6911 \\ \midrule
\multicolumn{7}{c}{ Robust standard errors in parentheses} \\
\multicolumn{7}{c}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabular}}

%\end{landscape}




\end{document}  

在之前的表格中,我使用了以下代码,但这些代码似乎不适用于上表。

\setcounter{table}{3}
\captionsetup{font=large} 
  \caption{Table Title}
           \floatfoot{\footnotesize   \begin{spacing}{0.89} This table shows... \\ 
\end{spacing} }  

同样,理想的结果应该如下图所示:

在此处输入图片描述

任何帮助将不胜感激!

答案1

table您可以使用环境和命令来实现所需的结果,\caption如以下示例所示:

\documentclass[final,3p,times,12pt]{elsarticle}
\usepackage{caption}
\usepackage{booktabs}

\begin{document}
\begin{table}
\small \setlength{\tabcolsep}{4pt}
\captionsetup{font=large} 
  \caption{Table Title}
  {\footnotesize   This table shows...  This table shows...   This table shows...   This table shows...   This table shows...   This table shows...   This table shows...   This table shows...   This table shows...   This table shows...   This table shows... }\smallskip

\centering  
\begin{tabular}{@{}lcccccc@{}} 
\toprule
& \multicolumn{6}{c}{Dependent Variable: Y}\\
\cmidrule{2-7}
& \multicolumn{3}{c}{City-State Level} & \multicolumn{3}{c}{State-Level}\\
\cmidrule(r){2-4} \cmidrule(l){5-7}
 & (1) & (2) & (3) & (4) & (5) & (6) \\
\midrule
 &  &  &  &  &  &  \\
X & 0.198*** & 0.216*** & 0.141*** & 0.324*** & 0.305*** & 0.189*** \\
 & (0.0472) & (0.0399) & (0.0394) & (0.0456) & (0.0407) & (0.0374) \\ \addlinespace
X2 & 0.153** & 0.281*** & 0.282*** & 0.353*** & 0.518*** & 0.448*** \\
 & (0.0632) & (0.0627) & (0.0592) & (0.0854) & (0.0834) & (0.0718) \\ \addlinespace
X3 & 0.0577 & -0.0426 & -0.0985* & 0.0102 & -0.133* & -0.158** \\
 & (0.0555) & (0.0519) & (0.0508) & (0.0715) & (0.0693) & (0.0628) \\ \addlinespace
Number of Nonstop  &  &  & -0.0105*** &  &  & -0.00816** \\
Carriers &  &  & (0.00262) &  &  & (0.00350) \\ \addlinespace
Bus Indicator &  &  & -0.118*** &  &  & -0.148*** \\
 &  &  & (0.00936) &  &  & (0.0137) \\ \addlinespace
Other PMS Indicator &  &  & -0.0589*** &  &  & -0.0982*** \\
 &  &  & (0.00743) &  &  & (0.0101) \\ \addlinespace
Share of Passengers Traveling  &  &  & 0.129*** &  &  & 0.177*** \\
Connect, City-Level &  &  & (0.0173) &  &  & (0.0192) \\ \addlinespace
Share of Passengers Traveling  &  &  & 0.104*** &  &  & 0 \\
Connect &  &  & (0.0139) &  &  & (5.35e-09) \\ \addlinespace
Log(Population) &  &  & 0.304*** &  &  & 0.341*** \\
 &  &  & (0.106) &  &  & (0.122) \\ \addlinespace
Log(Income Per Capita) &  &  & 0.373*** &  &  & 0.318*** \\
 &  &  & (0.102) &  &  & (0.109) \\ \addlinespace
Constant & 5.043*** & 6.100*** & 5.545*** & 4.936*** & 0.636 & 2.836*** \\
 & (0.0203) & (0.249) & (0.447) & (0.0279) & (0.586) & (0.669) \\ \addlinespace
 &  &  &  &  &  &  \\
Observations & 1,237,878 & 1,237,878 & 1,209,791 & 262,534 & 262,534 & 255,173 \\
R-squared & 0.821 & 0.826 & 0.836 & 0.852 & 0.861 & 0.876 \\
Number of city-state pairs & 46510 & 46510 & 45244 &  &  &  \\
 Number of cities &  &  &  & 7190 & 7190 & 6911 \\ \midrule
\multicolumn{7}{c}{ Robust standard errors in parentheses} \\
\multicolumn{7}{c}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabular}

\end{table}

\end{document}  

在此处输入图片描述

使用这种方法,表格会自动编号,因此(通常)不需要像这样的命令\setcounter{table}{3}

相关内容