使用resizebox缩放表格的问题

使用resizebox缩放表格的问题

我的表格太宽了。使用 resizebox 时,表格的颜色会太浅。如何缩放表格同时保持正常颜色?谢谢。

\begin{table}[H]
  \Large
  \renewcommand\arraystretch{1.5}
    \centering 
    \caption{} 
    \label{}
    \resizebox{\textwidth}{!}{
    \smallskip
    \begin{tabular}{@{} l*{9}{d{-2}} @{}} 
    \toprule
    \multicolumn{9}{l}{\textit{Panel A: Regressions using Participation Rate}} \\ 
    \cmidrule(lr){1-10} 
    &\multicolumn{3}{c@{}}{Full Sample} 
    &\multicolumn{3}{c@{}}{Group 1} 
    &\multicolumn{3}{c@{}}{Group 2} 
    \\\cmidrule(lr){2-4}\cmidrule(lr){5-7}\cmidrule(lr){8-10}
    & \mc{(1)} & \mc{(2)} & \mc{(3)} 
    & \mc{(4)} & \mc{(5)} & \mc{(6)} 
    & \mc{(7)} & \mc{(8)} & \mc{(9)} \\ 
    \midrule
    |\textit{BSCor}| 
    & -0.297^{***} & -0.210^{***} & -0.116^{***}
    & -0.345^{***} & -0.267^{***} & 0.046
    & -0.230^{***} & -0.180^{***} & 0.046\\ 
      & (0.036) & (0.034) & (0.035)
      & (0.053) & (0.052) & (0.046)
      & (0.046) & (0.045) & (0.046) \\ 
    \textit{Cor} 
    & & 0.019 & 0.026 
    & & -0.026 & 0.003
    & & 0.043^{*} & 0.003\\ 
      & & (0.021) & (0.020) 
      & & (0.032) & (0.003)
      & & (0.026) & (0.003)\\ 
    \textit{ln(y)} 
    &  & 0.422^{***}  & 0.338^{***}
    &  & 0.442^{***} & 0.043^{**}
    &  & 0.253^{***} & 0.253^{**} \\ 
      &  & (0.018) & (0.019)
      &  & (0.029) & (0.019)
      &  & (0.023) & (0.019) \\  
     \textit{age/10} 
     &  &  & -0.011
     &  &  & -0.004
     &  &  & -0.004 \\ 
      &  &  & (0.068)
      &  &  & (0.008)
      &  &  & (0.008) \\ 
      $age^2/100$ 
      &  &  & 0.003
      &  &  & -0.004
      &  &  & -0.004 \\ 
       &  &  & (0.008)
       &  &  & (0.008)
       &  &  & (0.008) \\ 
     \textit{Marriage} 
     &  &  & -0.162^{***}
     &  &  & -0.004
     &  &  & -0.004 \\ 
      &  &  & (0.025)
      &  &  & (0.008)
      &  &  & (0.008) \\
      \textit{FWealth} 
      &  &  & 0.044^{***}
      &  &  & -0.004
      &  &  & -0.004 \\ 
       &  &  & (0.002)
       &  &  & (0.008)
       &  &  & (0.008) \\
     $Std(d\delta)$
     &  &  & 0.019
      &  &  & -0.004
      &  &  & -0.004 \\ 
       &  &  & (0.050)
       &  &  & (0.008)
       &  &  & (0.008) \\
    $Skew(d\delta)$
    &  &  & -0.017^{*}
    &  &  & -0.004
    &  &  & -0.004 \\ 
      &  &  & (0.010)
      &  &  & (0.008)
      &  &  & (0.008) \\
    $Kurt(d\delta)$
    &  &  & -0.007
    &  &  & -0.004
    &  &  & -0.004 \\ 
      &  &  & (0.006)
      &  &  & (0.008)
      &  &  & (0.008) \\
    \midrule
       F-test & \multicolumn{1}{c}{0.2661} & \multicolumn{1}{c}{0.2122} & \multicolumn{1}{c}{$7.6729^{***}$} \\
       AIC & \multicolumn{1}{c}{37{,}997.73} & \multicolumn{1}{c}{38{,}099.51} & \multicolumn{1}{c}{33{,}477.07} \\
       N & \multicolumn{1}{c}{624} & \multicolumn{1}{c}{624} & \multicolumn{1}{c}{624} \\
    \bottomrule
    \multicolumn{3}{@{}l@{}}{$^{*}\, p<0.1$; $^{**}\, p<0.05$; $^{***}\, p<0.01$}
    \end{tabular} }
    \end{table}

在此处输入图片描述

答案1

通过使用\small字体大小和减少列之间的间隔,并且预期页面布局是geometry包中定义的默认布局,您可以得到以下结果:

在此处输入图片描述

(红线为文本区域的边框)

\documentclass{article}
\usepackage{geometry}

%---------------- Show page layout. Don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\sisetup{
    input-open-uncertainty =,
    input-close-uncertainty=,
        }
\ExplSyntaxOn
\NewChildSelector{eachtwo}
  {
    \int_step_inline:nnnn {4}{2}{\l_tblr_childs_total_tl}
      { \clist_put_right:Nn \l_tblr_childs_clist {##1} }
  }
\ExplSyntaxOff

\begin{document}
    \begin{table}[ht]
\sisetup{table-format={(}1.3{**}}

    \centering
    \small
\begin{talltblr}[
    caption={title},
      label={tab:tblr},
note{} = {Standard errors in parentheses:\newline
          *:    $p<0.10$,\quad
          **:   $p<0.05$,\quad
          ***:  $p<0.01$.}
               ]{colsep  = 4pt,
                 colspec = {@{} l*{9}{X[c,si]} @{}},
                 row{1}  = {font=\small\bfseries},
                 row{4-Z}= {rowsep=0pt},
                 row{eachtwo} = {abovesep=1ex},
                }
    \toprule
\SetCell[c=10]{l}   Panel A: Regressions using Participation Rate
    &   &   &   &   &   &   &   &\\
    \midrule
    & \SetCell[c=3]{c}  {{{Full Sample}}} 
        &   &   & \SetCell[c=3]{c}  {{{Group 1}}} 
                    & \SetCell[c=3]{c}  {{{Group 2}}}    
                        &   &               \\
    \cmidrule[lr]{2-4}  
    \cmidrule[lr]{5-7}
    \cmidrule[lr]{8-10}
    & {{{(1)}}} & {{{(2)}}} & {{{(3)}}}
    & {{{(4)}}} & {{{(5)}}} & {{{(6)}}}
    & {{{(7)}}} & {{{(8)}}} & {{{(9)}}}     \\
    \midrule
\textbar BSCor \textbar
    & -0.297\TblrNote{***}  & -0.210\TblrNote{***}  & -0.116\TblrNote{***}
    & -0.345\TblrNote{***}  & -0.267\TblrNote{***}  &  0.046
    & -0.230\TblrNote{***}  & -0.180\TblrNote{***}  &  0.046    \\
    & (0.036)               & (0.034)               & (0.035)
    & (0.053)               & (0.052)               & (0.046)
    & (0.046)               & (0.045)               & (0.046)   \\
Cor &                       & 0.019                 & 0.026
    &                       & -0.026                & 0.003
    &                       & 0.043\TblrNote{*}     & 0.003     \\
    &                       & (0.021)               & (0.020)
    &                       & (0.032)               & (0.003)
    &                       & (0.026)               & (0.003)   \\
$\ln(y)$ 
    &                       & 0.422\TblrNote{***}   & 0.338\TblrNote{***}
    &                       & 0.442\TblrNote{***}   & 0.043\TblrNote{**}
    &                       & 0.253\TblrNote{***}   & 0.253\TblrNote{**} \\
    &                       & (0.018)               & (0.019)
    &                       & (0.029)               & (0.019)
    &                       & (0.023)               & (0.019)   \\
age/10
    &                       &                       & -0.011
    &                       &                       & -0.004
    &                       &                       & -0.004 \\
    &                       &                       & (0.068)
    &                       &                       & (0.008)
    &                       &                       & (0.008) \\
age$^2/100$
    &                       &                       & 0.003
    &                       &                       & -0.004
    &                       &                       & -0.004 \\
    &                       &                       & (0.008)
    &                       &                       & (0.008)
    &                       &                       & (0.008) \\
Marriage 
    &                       &                       & -0.162\TblrNote{***}
    &                       &                       & -0.004
    &                       &                       & -0.004 \\
    &                       &                       & (0.025)
    &                       &                       & (0.008)
    &                       &                       & (0.008) \\
FWealth
    &                       &                       & 0.044\TblrNote{***}
    &                       &                       & -0.004
    &                       &                       & -0.004 \\
    &                       &                       & (0.002)
    &                       &                       & (0.008)
    &                       &                       & (0.008) \\
Std$(d\delta)$
    &                       &                       & 0.019
    &                       &                       & -0.004
    &                       &                       & -0.004 \\
    &                       &                       & (0.050)
    &                       &                       & (0.008)
    &                       &                       & (0.008) \\
Skew$(d\delta)$
    &                       &                       & -0.017\TblrNote{*}
    &                       &                       & -0.004
    &                       &                       & -0.004 \\
    &                       &                       & (0.010)
    &                       &                       & (0.008)
    &                       &                       & (0.008) \\
Kurt$(d\delta)$
    &                       &                       & -0.007
    &                       &                       & -0.004
    &                       &                       & -0.004 \\
    &                       &                       & (0.006)
    &                       &                       & (0.008)
    &                       &                       & (0.008) \\
    \midrule
\end{talltblr}
    \end{table}
\end{document}
F-test 
    & {{{0.2661}}}         & {{{0.2122}}}           & {{{7.6729\TblrNote{***}}}}%   \\
AIC & {{{37997.73}}}       & {{{{38099.51}}}        & {{{33 477.07}}}           %   \\
N   & {{{624}}}}           & {{{{624}}}             & {{{624}}}                 \\
    \bottomrule
\end{talltblr}
    \end{table}
\end{document}

相关内容