关于跨多页表格的简单问题

关于跨多页表格的简单问题

以下代码创建了一个跨两页的表格。但是,我遇到了三个问题:

  1. 表格无法正确放入页面,并且对齐方式很奇怪。我之前使用过tabularx,该表格可以很好地放入(在给定的页面上,但无法跨越到下一页)。虽然@Werner 之前给我重定向的帖子提供了一些有用的提示,但我遇到了这些问题。有没有简单的方法可以解决这个问题?为了说明我想要实现的目标,请参见下面的图片示例 1(使用构建tabularx),其中表格正确居中。
  2. 同样,行现在也没有对齐,并且行与行之间的间隙不均匀。同样,示例 1 不会遇到这样的问题。
  3. 这是一个小问题,但如示例 1 所示,第一行比下面的行更粗。有没有办法用 longtable 来实现这一点(即下面的代码)?

话虽如此,我还是要感谢 @leandriis 早些时候试图帮助解决类似的问题。尽管 @leandriis 善意地建议我应该使用xltabular,但我找不到很多有用的示例让我可以使用这个包构建表格。@leandriis,你认为上述三点可以用来解决吗xltabular

在此先感谢您的任何建议!

以下是代码:

\documentclass[final,3p,times,12pt]{elsarticle}
\usepackage{caption}
\captionsetup{font=large} 
\usepackage{array}
\newcolumntype{M}[1]{>{\raggedright}m{#1}}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{bbm}
\usepackage{longtable}

\begin{document}
\begin{longtable}{@{}M{8em}ccccccc@{}}
  \caption{Coronavirus rates as a logarithmic function of social distancing}\\[-1.5ex]
  \multicolumn{7}{@{}p{\linewidth}@{}}{\footnotesize  Something something something something something something something something something something something something something something something something something something something something something something something something something something something something something. }  
  \\ [8ex]
\toprule
& \multicolumn{7}{c}{Dependent Variable: $\mathbbm{1}${(Death$_{j,t}$)}} \\ 

 & (1) & (2) & (3) & (4) & (5) & (6)& (7) \\
\midrule
\endfirsthead
\multicolumn{7}{@{}l@{}}{continues from the previous page}\\
\midrule
& \multicolumn{7}{c}{Dependent Variable: $\mathbbm{1}${(Death$_{j,t}$)}} \\
 & (1) & (2) & (3) & (4) & (5) & (6) & (7) \\

\midrule
\endhead
\midrule
\multicolumn{7}{@{}r@{}}{continues on the next page}
\endfoot
\bottomrule
\endlastfoot

$\mathbbm{1}${(Not Social Distancing$_{j,t}$)}
 & 0.322& 0.278& 0.276 & 0.387*** & 0.304*** & 0.305*** & 0.381*** \\
 & (0.3333) & (0.2232) & (0.2323) & (0.333) & (0.334) & (0.334) & (0.333) \\   
$\mathbbm{1}${(Pnst  Type$_{j,t}$)} &  &  &  &  & 0.331*** & 0.331*** &  \\
 &  &  &  &  & (0.3359) & (0.3359) &  \\   
$\mathbbm{1}${(Long variable name$_{j,t}$)} &  &  &  &  & -0.3315 & -0.3313 &  \\
 &  &  &  &  & (0.3313) & (0.3313) &  \\   
$\mathbbm{1}${(Intense 3$_{j,t}$)} &  &  &  &  & 0.07** & 0.08** & 0.06* \\
 &  &  &  &  & (0.000) & (0.000) & (0.000) \\  
 $\mathbbm{1}${(Insurance$_{j,t}$)}&  &  &  &  & 0.133 & 0.149 & 0.114 \\
 &  &  &  &  & (0.090) & (0.090) & (0.091) \\  
$\mathbbm{1}${(Gender$_{j,t}$)} &  &  &  &  & 0.3*** & 0.3*** & 0.07** \\
 &  &  &  &  & (0.021) & (0.021) & (0.067) \\  
$\mathbbm{1}${(Facility P$_{j,t}$)} &  &  &  &  & 0.006 & 0.005 & 0.025** \\
 &  &  &  &  & (0.008) & (0.008) & (0.033) \\  
$\mathbbm{1}${(Att$_{j,t}$)} &  &  &  &  & 0.3345 & 0.0234 & 0.0215 \\
 &  &  &  &  & (0.038) & (0.042) & (0.333) \\  
$\mathbbm{1}${(Ptt$_{j,t}$)}&  &  &  &  & 0.0988 & 0.0849 & 0.0873 \\
 &  &  &  &  & (0.153) & (0.151) & (0.203) \\  
$\mathbbm{1}${(Variable 3$_{[1,5],}$ $_{j,t}$)} &  &  &  &  & 0.315 & 0.327 & 0.229 \\
 &  &  &  &  & (0.206) & (0.202) & (0.200) \\  
$\mathbbm{1}${(Variable 3$_{(5,11],}$ $_{j,t}$)} &  &  &  &  & -0.336 & 0.025 & 0.007 \\
 &  &  &  &  & (0.043) & (0.042) & (0.023) \\  
$\mathbbm{1}${(Variable 3$_{(11,20],}$ $_{j,t}$)}&  &  &  &  & -0.43** & -0.33** & -0.40** \\
 &  &  &  &  & (0.178) & (0.175) & (0.185) \\  
$\mathbbm{1}${(Variable 3$_{(20,35],}$ $_{j,t}$)}&  &  &  &  & 1.203** & 1.116** & 1.066* \\
 &  &  &  &  & (0.534) & (0.538) & (0.565) \\  
$\mathbbm{1}${(Variable 3$_{>35},$ $_{j,t}$)} &  &  &  &  & 0.020 & 0.030 & 0.003 \\
 &  &  &  &  & (0.0420) & (0.0433) & (0.0219) \\  
$\mathbbm{1}${(Age Group 1$_{j,t}$)}  &  &  &  &  & 0.291*** & 0.218** & 0.213** \\
 &  &  &  &  & (0.119) & (0.116) & (0.0846) \\  
$\mathbbm{1}${(Age Group 2$_{j,t}$)} &  &  &  &  & 0.3392 & 0.0823 & 0.0702 \\
 &  &  &  &  & (0.337) & (0.337) & (0.117) \\  
$\mathbbm{1}${(Age Group 3$_{j,t}$)} &  &  &  &  & 0.0250 & 0.0207 & 0.3379 \\
 &  &  &  &  & (0.021) & (0.021) & (0.023) \\  
$\mathbbm{1}${(Age Group 4$_{j,t}$)} &  &  &  &  & 0.0621 & -0.334 & -0.3355 \\
 &  &  &  &  & (0.120) & (0.339) & (0.121) \\  
$\mathbbm{1}${(Age Group 5$_{j,t}$)} &  &  &  &  & 0.137 & 0.355** & 0.123 \\
 &  &  &  &  & (0.160) & (0.157) & (0.166) \\  

 \hline 

\midrule
\textbf{Fixed Effects} \\     
Time &X&X&X&X&X&X&X \\    
Country &&X&X&&X&X & \\    
Time$\times$Country &&&X&&&X & \\    
Location &&&&X&&&X \\    
\midrule
Observations & 16,175 & 16,175 & 16,158 & 16,059 & 15,041 & 15,041 & 14,941 \\  
 R-squared & 0.095 & 0.144 & 0.193 & 0.353 & 0.171 & 0.205 & 0.357 \\ \hline


\end{longtable}

\end{document}

在此处输入图片描述

修改: 根据@Bernard的建议,我修改了代码:

\documentclass{article}
\usepackage{caption}
\captionsetup{font=large} 
\usepackage{array}
\newcolumntype{M}[1]{>{\raggedright}m{#1}}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{bbm}
\usepackage{xltabular}
\usepackage{pdflscape}


\begin{document}
\begin{landscape}
\vspace*{-3cm}
\begin{xltabular}[l]{0.55\linewidth}{@{}X*8{c}@{}}
  \caption{Coronavirus rates as a logarithmic function of social distancing}\\[-1.5ex]
  \multicolumn{7}{@{}p{\linewidth}@{}}{\footnotesize  Something something something something something something something something something something something something something something something something something something something something something something something something something something something something something. }  \\ [8ex]
\toprule
& \multicolumn{8}{c}{Dependent Variable: $\mathbbm{1}${(Death$_{j,t}$)}} \\ 

 & (1) & (2) & (3) & (4) & (5) & (6)& (7) \\
\midrule
\endfirsthead
\multicolumn{8}{@{}l@{}}{continues from the previous page}\\
\midrule
& \multicolumn{8}{c}{Dependent Variable: $\mathbbm{1}${(Death$_{j,t}$)}} \\
 & (1) & (2) & (3) & (4) & (5) & (6) & (7) \\

\midrule
\endhead
\midrule
\multicolumn{8}{@{}r@{}}{continues on the next page}
\endfoot
\bottomrule
\endlastfoot

$\mathbbm{1}${(Not Social Distancing$_{j,t}$)}
 & 0.322& 0.278& 0.276 & 0.387*** & 0.304*** & 0.305*** & 0.381*** \\ 
 & (0.3333) & (0.2232) & (0.2323) & (0.333) & (0.334) & (0.334) & (0.333) \\   
$\mathbbm{1}${(Pnst  Type$_{j,t}$)} &  &  &  &  & 0.331*** & 0.331*** &  \\
 &  &  &  &  & (0.3359) & (0.3359) &  \\   
$\mathbbm{1}${(Long variable name$_{j,t}$)} &  &  &  &  & -0.3315 & -0.3313 &  \\
 &  &  &  &  & (0.3313) & (0.3313) &  \\   
$\mathbbm{1}${(Intense 3$_{j,t}$)} &  &  &  &  & 0.07** & 0.08** & 0.06* \\
 &  &  &  &  & (0.000) & (0.000) & (0.000) \\  
 $\mathbbm{1}${(Insurance$_{j,t}$)}&  &  &  &  & 0.133 & 0.149 & 0.114 \\
 &  &  &  &  & (0.090) & (0.090) & (0.091) \\  
$\mathbbm{1}${(Gender$_{j,t}$)} &  &  &  &  & 0.3*** & 0.3*** & 0.07** \\
 &  &  &  &  & (0.021) & (0.021) & (0.067) \\  
$\mathbbm{1}${(Facility P$_{j,t}$)} &  &  &  &  & 0.006 & 0.005 & 0.025** \\
 &  &  &  &  & (0.008) & (0.008) & (0.033) \\  
$\mathbbm{1}${(Att$_{j,t}$)} &  &  &  &  & 0.3345 & 0.0234 & 0.0215 \\
 &  &  &  &  & (0.038) & (0.042) & (0.333) \\  
$\mathbbm{1}${(Ptt$_{j,t}$)}&  &  &  &  & 0.0988 & 0.0849 & 0.0873 \\
 &  &  &  &  & (0.153) & (0.151) & (0.203) \\  
$\mathbbm{1}${(Variable 3$_{[1,5],}$ $_{j,t}$)} &  &  &  &  & 0.315 & 0.327 & 0.229 \\
 &  &  &  &  & (0.206) & (0.202) & (0.200) \\  
$\mathbbm{1}${(Variable 3$_{(5,11],}$ $_{j,t}$)} &  &  &  &  & -0.336 & 0.025 & 0.007 \\
 &  &  &  &  & (0.043) & (0.042) & (0.023) \\  
$\mathbbm{1}${(Variable 3$_{(11,20],}$ $_{j,t}$)}&  &  &  &  & -0.43** & -0.33** & -0.40** \\
 &  &  &  &  & (0.178) & (0.175) & (0.185) \\  
$\mathbbm{1}${(Variable 3$_{(20,35],}$ $_{j,t}$)}&  &  &  &  & 1.203** & 1.116** & 1.066* \\
 &  &  &  &  & (0.534) & (0.538) & (0.565) \\  
$\mathbbm{1}${(Variable 3$_{>35},$ $_{j,t}$)} &  &  &  &  & 0.020 & 0.030 & 0.003 \\
 &  &  &  &  & (0.0420) & (0.0433) & (0.0219) \\  
$\mathbbm{1}${(Age Group 1$_{j,t}$)}  &  &  &  &  & 0.291*** & 0.218** & 0.213** \\
 &  &  &  &  & (0.119) & (0.116) & (0.0846) \\  
$\mathbbm{1}${(Age Group 2$_{j,t}$)} &  &  &  &  & 0.3392 & 0.0823 & 0.0702 \\
 &  &  &  &  & (0.337) & (0.337) & (0.117) \\  
$\mathbbm{1}${(Age Group 3$_{j,t}$)} &  &  &  &  & 0.0250 & 0.0207 & 0.3379 \\
 &  &  &  &  & (0.021) & (0.021) & (0.023) \\  
$\mathbbm{1}${(Age Group 4$_{j,t}$)} &  &  &  &  & 0.0621 & -0.334 & -0.3355 \\
 &  &  &  &  & (0.120) & (0.339) & (0.121) \\  
$\mathbbm{1}${(Age Group 5$_{j,t}$)} &  &  &  &  & 0.137 & 0.355** & 0.123 \\
 &  &  &  &  & (0.160) & (0.157) & (0.166) \\  

 \hline 

\midrule
\textbf{Fixed Effects} \\     
Time &X&X&X&X&X&X&X \\    
Country &&X&X&&X&X & \\    
Time$\times$Country &&&X&&&X & \\    
Location &&&&X&&&X \\    
\midrule
Observations & 16,175 & 16,175 & 16,158 & 16,059 & 15,041 & 15,041 & 14,941 \\  
 R-squared & 0.095 & 0.144 & 0.193 & 0.353 & 0.171 & 0.205 & 0.357 \\ \hline


\end{xltabular}

\end{landscape}

\end{document}

除了每列的列长度不一样(即,第 5、6、7 列之间的间隙更大)之外,此代码运行良好。

答案1

  • 非常。非常实际的表格......
  • 我将使用S列作为第 2 至第 8 列
  • 计算\tabcolsep左至 LaTeX
  • 适用于桌面longtable设置\setlength\LTleft{0pt}\setlength\LTright{0pt}
  • 将表格的字体大小减小到\small
\documentclass[final,3p,times,12pt]{elsarticle}
\usepackage{caption}
\captionsetup{font=small}
\usepackage{array}
\newcolumntype{M}[1]{>{\raggedright}m{#1}}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{bbm}
\usepackage{longtable}
\usepackage{siunitx}

\begin{document}
\begingroup
\small
\sisetup{table-format=1.4,
         table-space-text-pre=(,
         table-space-text-post=***,
         table-align-text-post=false,
         input-symbols=()
         }
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\setlength\tabcolsep{0pt}
    \begin{longtable}{@{\extracolsep{\fill}}    M{8em}
                                           *{7}{S}}
\caption[Coronavirus rates as a logarithmic function of social distancing]
        {Coronavirus rates as a logarithmic function of social distancing\\[1ex]
        \footnotesize  
        Something something something something something something something something something something something something something something something something something something something something something something something something something something something something something. }
\label{tab:čongtable-covit-19}  \\
    \toprule
\multicolumn{1}{c}{}
    & \multicolumn{7}{c}{Dependent Variable: $\mathbbm{1}${(Death$_{j,t}$)}} \\
    \cmidrule{2-8}
\multicolumn{1}{c}{}
    & {(1)} & {(2)} & {(3)} & {(4)} & {(5)} & {(6)} & {(7)} \\
    \midrule
\endfirsthead
    \caption[]{Coronavirus rates as a logarithmic function of social distancing (cont.)} \\
    \midrule
\multicolumn{1}{c}{}
    & \multicolumn{7}{c}{Dependent Variable: $\mathbbm{1}${(Death$_{j,t}$)}} \\
    \cmidrule{2-8}
\multicolumn{1}{c}{}
    & {(1)} & {(2)} & {(3)} & {(4)} & {(5)} & {(6)} & {(7)} \\
    \midrule
\endhead
    \midrule
\multicolumn{7}{@{}r@{}}{\footnotesize\textit{continues on the next page}}
\endfoot
    \bottomrule
\endlastfoot

$\mathbbm{1}$ (Not Social Distancing$_{j,t}$)
    & 0.322     & 0.278     & 0.276     & 0.387***  & 0.304***  & 0.305***  & 0.381***  \\
    & (0.3333)  & (0.2232)  & (0.2323)  & (0.333)   & (0.334)   & (0.334)   & (0.333)   \\
$\mathbbm{1}$ (Pnst  Type$_{j,t}$)    
    &           &           &           &           & 0.331***  & 0.331***  &           \\
    &           &           &           &           & (0.3359)  & (0.3359)  &           \\
$\mathbbm{1}$ (Long variable name$_{j,t}$)    
    &           &           &           &           & -0.3315   & -0.3313   &           \\
    &           &           &           &           & (0.3313)  & (0.3313)  &           \\
$\mathbbm{1}$ (Intense 3$_{j,t}$)     
    &           &           &           &           & 0.07**    & 0.08**    & 0.06*     \\
    &           &           &           &           & (0.000)   & (0.000)   & (0.000)   \\
$\mathbbm{1}$ (Insurance$_{j,t}$) 
    &           &           &           &           & 0.133     & 0.149     & 0.114     \\
    &           &           &           &           & (0.090)   & (0.090)   & (0.091)   \\
$\mathbbm{1}$ (Gender$_{j,t}$) 
    &           &           &           &           & 0.3***    & 0.3***    & 0.07**    \\
    &           &           &           &           & (0.021)   & (0.021)   & (0.067)   \\
$\mathbbm{1}$ (Facility P$_{j,t}$)  
    &           &           &           &           & 0.006     & 0.005     & 0.025**   \\
    &           &           &           &           & (0.008)   & (0.008)   & (0.033)   \\
$\mathbbm{1}$ (Att$_{j,t}$)  
    &           &           &           &           & 0.3345    & 0.0234    & 0.0215    \\
    &           &           &           &           & (0.038)   & (0.042)   & (0.333)   \\
$\mathbbm{1}$ (Ptt$_{j,t}$) 
    &           &           &           &           & 0.0988    & 0.0849    & 0.0873    \\
    &           &           &           &           & (0.153)   & (0.151)   & (0.203)   \\
$\mathbbm{1}$ (Variable 3$_{[1,5],}$ $_{j,t}$)  
    &           &           &           &           & 0.315     & 0.327     & 0.229     \\
    &           &           &           &           & (0.206)   & (0.202)   & (0.200)   \\
$\mathbbm{1}$ (Variable 3$_{(5,11],}$ $_{j,t}$) 
    &           &           &           &           & -0.336    & 0.025     & 0.007     \\
    &           &           &           &           & (0.043)   & (0.042)   & (0.023)   \\
$\mathbbm{1}$ (Variable 3$_{(11,20],}$ $_{j,t}$) 
    &           &           &           &           & -0.43**   & -0.33**   & -0.40**   \\
    &           &           &           &           & (0.178)   & (0.175)   & (0.185)   \\
$\mathbbm{1}$ (Variable 3$_{(20,35],}$ $_{j,t}$) 
    &           &           &           &           & 1.203**   & 1.116**   & 1.066*    \\
    &           &           &           &           & (0.534)   & (0.538)   & (0.565)   \\
$\mathbbm{1}$ (Variable 3$_{>35},$ $_{j,t}$) 
    &           &           &           &           & 0.020     & 0.030     & 0.003     \\
    &           &           &           &           & (0.0420)  & (0.0433)  & (0.0219)  \\
$\mathbbm{1}$ (Age Group 1$_{j,t}$)   
    &           &           &           &           & 0.291***  & 0.218**   & 0.213**   \\
    &           &           &           &           & (0.119)   & (0.116)   & (0.0846)  \\
$\mathbbm{1}$ (Age Group 2$_{j,t}$) 
    &           &           &           &           & 0.3392    & 0.0823    & 0.0702    \\
    &           &           &           &           & (0.337)   & (0.337)   & (0.117)   \\
$\mathbbm{1}$ (Age Group 3$_{j,t}$) 
    &           &           &           &           & 0.0250    & 0.0207    & 0.3379    \\
    &           &           &           &           & (0.021)   & (0.021)   & (0.023)   \\
$\mathbbm{1}$ (Age Group 4$_{j,t}$)  
    &           &           &           &           & 0.0621    & -0.334    & -0.3355   \\
    &           &           &           &           & (0.120)   & (0.339)   & (0.121)   \\
$\mathbbm{1}$ (Age Group 5$_{j,t}$)  
    &           &           &           &           & 0.137     & 0.355**   & 0.123     \\
    &           &           &           &           & (0.160)   & (0.157)   & (0.166)   \\
    \midrule
\textbf{Fixed Effects} \\
Time    
    & {X}       & {X}       & {X}       & {X}       & {X}       & {X}       & {X}       \\
Country 
    &           & {X}       & {X}       &           & {X}       & {X}       & {X}       \\
Time$\times$Country 
    &           &           & {X}       &           &           & {X}       &           \\
Location
    &           &           &           & {X}       &           &           & {X}       \\
\midrule
Observations    
    & {16,175}  & {16,175}  & {16,158}  & {16,059}  & {15,041}  & {15,041}  & {14,941}  \\
R-squared       
    & 0.095     & 0.144     & 0.193     & 0.353     & 0.171     & 0.205     & 0.357     \\
    \end{longtable}
\endgroup
\end{document}

在此处输入图片描述

附录 不清楚$\mathbbm{1}$第一列内容中单元格之前的含义。我会将它们连同单元格内容周围的括号一起删除。这样可以为表格获得更多空间。此外,我还会在表格第一部分的每个第二行之间引入小的垂直空间。在表格的第二部分中,请考虑您在以下评论中提出的问题:

\documentclass[final,3p,times,12pt]{elsarticle}
\usepackage{caption}
\captionsetup{font=small}
\usepackage{booktabs, longtable}
\newcommand\mcc[1]{\multicolumn{1}{c}{#1}}
\usepackage{bbm}
\usepackage{siunitx}

\begin{document}
\begingroup
\footnotesize
\sisetup{table-format=1.4,
         table-space-text-pre=(,
         table-space-text-post=***,
         table-align-text-post=false,
         input-symbols=(),
         table-alignment=right
         }
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\setlength\tabcolsep{0pt}
    \begin{longtable}{@{\extracolsep{\fill}} l
                                           *{7}{S}}
\caption[Coronavirus rates as a logarithmic function of social distancing]
        {Coronavirus rates as a logarithmic function of social distancing\\[1ex]
        \footnotesize  
        Something something something something something something something something something something something something something something something something something something something something something something something something something something something something something. }
\label{tab:čongtable-covit-19}  \\
    \toprule
\multicolumn{1}{c}{}
    & \multicolumn{7}{c}{Dependent Variable: $\mathbbm{1}${(Death$_{j,t}$)}} \\
    \cmidrule{2-8}
\multicolumn{1}{c}{}
    & \mcc{(1)} & \mcc{(2)} & \mcc{(3)} & \mcc{(4)} & \mcc{(5)} & \mcc{(6)} & \mcc{(7)} \\
    \midrule
\endfirsthead
    \caption[]{Coronavirus rates as a logarithmic function of social distancing (cont.)} \\
    \midrule
\multicolumn{1}{c}{}
    & \multicolumn{7}{c}{Dependent Variable: $\mathbbm{1}${(Death$_{j,t}$)}} \\
    \cmidrule{2-8}
\multicolumn{1}{c}{}
    & \mcc{(1)} & \mcc{(2)} & \mcc{(3)} & \mcc{(4)} & \mcc{(5)} & \mcc{(6)} & \mcc{(7)} \\
    \midrule
\endhead
    \midrule
\multicolumn{8}{@{}r@{}}{\footnotesize\textit{continues on the next page}}
\endfoot
    \bottomrule
\endlastfoot

Not Social Distancing$_{j,t}$
    & 0.322     & 0.278     & 0.276     & 0.387***  & 0.304***  & 0.305***  & 0.381***  \\
    & (0.3333)  & (0.2232)  & (0.2323)  & (0.333)   & (0.334)   & (0.334)   & (0.333)   \\
    \addlinespace
Pnst  Type$_{j,t}$    
    &           &           &           &           & 0.331***  & 0.331***  &           \\
    &           &           &           &           & (0.3359)  & (0.3359)  &           \\
    \addlinespace
Long variable name$_{j,t}$    
    &           &           &           &           & -0.3315   & -0.3313   &           \\
    &           &           &           &           & (0.3313)  & (0.3313)  &           \\
    \addlinespace
Intense 3$_{j,t}$     
    &           &           &           &           & 0.07**    & 0.08**    & 0.06*     \\
    &           &           &           &           & (0.000)   & (0.000)   & (0.000)   \\
    \addlinespace
Insurance$_{j,t}$ 
    &           &           &           &           & 0.133     & 0.149     & 0.114     \\
    &           &           &           &           & (0.090)   & (0.090)   & (0.091)   \\
    \addlinespace
Gender$_{j,t}$ 
    &           &           &           &           & 0.3***    & 0.3***    & 0.07**    \\
    &           &           &           &           & (0.021)   & (0.021)   & (0.067)   \\
    \addlinespace
Facility P$_{j,t}$  
    &           &           &           &           & 0.006     & 0.005     & 0.025**   \\
    &           &           &           &           & (0.008)   & (0.008)   & (0.033)   \\
    \addlinespace
Att$_{j,t}$  
    &           &           &           &           & 0.3345    & 0.0234    & 0.0215    \\
    &           &           &           &           & (0.038)   & (0.042)   & (0.333)   \\
    \addlinespace
Ptt$_{j,t}$ 
    &           &           &           &           & 0.0988    & 0.0849    & 0.0873    \\
    &           &           &           &           & (0.153)   & (0.151)   & (0.203)   \\
    \addlinespace
Variable 3$_{[1,5]\;j,t}$  
    &           &           &           &           & 0.315     & 0.327     & 0.229     \\
    &           &           &           &           & (0.206)   & (0.202)   & (0.200)   \\
    \addlinespace
Variable 3$_{(5,11],\;j,t)}$ 
    &           &           &           &           & -0.336    & 0.025     & 0.007     \\
    &           &           &           &           & (0.043)   & (0.042)   & (0.023)   \\
    \addlinespace
Variable 3$_{(11,20],\;j,t)}$
    &           &           &           &           & -0.43**   & -0.33**   & -0.40**   \\
    &           &           &           &           & (0.178)   & (0.175)   & (0.185)   \\
    \addlinespace
Variable 3$_{(20,35],\;j,t)}$
    &           &           &           &           & 1.203**   & 1.116**   & 1.066*    \\
    &           &           &           &           & (0.534)   & (0.538)   & (0.565)   \\
    \addlinespace
Variable 3$_{>35,\;j,t}$
    &           &           &           &           & 0.020     & 0.030     & 0.003     \\
    &           &           &           &           & (0.0420)  & (0.0433)  & (0.0219)  \\
    \addlinespace
Age Group 1$_{j,t}$   
    &           &           &           &           & 0.291***  & 0.218**   & 0.213**   \\
    &           &           &           &           & (0.119)   & (0.116)   & (0.0846)  \\
    \addlinespace
Age Group 2$_{j,t}$ 
    &           &           &           &           & 0.3392    & 0.0823    & 0.0702    \\
    &           &           &           &           & (0.337)   & (0.337)   & (0.117)   \\
    \addlinespace
Age Group 3$_{j,t}$ 
    &           &           &           &           & 0.0250    & 0.0207    & 0.3379    \\
    &           &           &           &           & (0.021)   & (0.021)   & (0.023)   \\
    \addlinespace
Age Group 4$_{j,t}$  
    &           &           &           &           & 0.0621    & -0.334    & -0.3355   \\
    &           &           &           &           & (0.120)   & (0.339)   & (0.121)   \\
    \addlinespace
Age Group 5$_{j,t}$  
    &           &           &           &           & 0.137     & 0.355**   & 0.123     \\
    &           &           &           &           & (0.160)   & (0.157)   & (0.166)   \\
    \midrule
\textbf{Fixed Effects} \\
Time    
    & {X}       & {X}       & {X}       & {X}       & {X}       & {X}       & {X}       \\
Country 
    &           & {X}       & {X}       &           & {X}       & {X}       & {X}       \\
Time$\times$Country 
    &           &           & {X}       &           &           & {X}       &           \\
Location
    &           &           &           & {X}       &           &           & {X}       \\
\midrule
Observations    
    & {16,175}  & {16,175}  & {16,158}  & {16,059}  & {15,041}  & {15,041}  & {14,941}  \\
R-squared       
    & {0.095}     & {0.144} & {0.193}   & {0.353}   & {0.171}   & {0.205}   & {0.357}   \\
    \end{longtable}
\endgroup
\end{document}

在此处输入图片描述

编辑:

  • S列在包中定义siunitx。它们用于将数字在小数点处对齐。
  • 在设置中定义列的特征S如下:
    • 带有 的数字的大小tabular-format=<num. of inteders>.>num of decimal digits
    • 数字前的附加空格为table-space-text-pre=(
    • 数字后面带有 的附加空格table-space-text-pre=***
    • 将括号后和*数字后用对齐table-align-text-post=false
    • 输入符号,这些符号被视为数字形式()),用于表格中)input-symbols=()
    • 用于右对齐S列中的文本table-alignment=right(根据我的测试,我会省略此选项并使用默认设置,即center。在这种情况下,您还可以删除\mcc命令的定义及其在表头中的使用,如第一个示例中所做的那样)。
  • 要将单元格的内容放在第一列,只需用 替换Ml,但这样您需要减小列大小,以便表格可以适合文本宽度。

相关内容