我如何对齐我的列值,使得它们都位于彼此之下,并且数字值不会发生负移?

我如何对齐我的列值,使得它们都位于彼此之下,并且数字值不会发生负移?

我试图对齐所有值,以便所有数字直接对齐。然而,负数似乎弄乱了它。

我有这段代码,它看起来像这样:

{
\renewcommand{\arraystretch}{1.4}
\tabcolsep=1.0\tabcolsep
\begin{sidewaystable}\fontsize{8pt}{8pt}\selectfont
\caption{Estimated Production Elasticities, Returns to Scale, and Rates of Techni Variables)}
\label{t52}
\begin{tabular}{lp{15mm}p{15mm}p{15mm}p{15mm}p{15mm}p{15mm}p{15mm}p{15mm}p{15mm}p{15mm}}\hline
 \hline
\scell{Period 2 vs. \\ Period 1} &
\scell{Difference\\ in Growth\\ Rate} &
\scell{Change in \\Elasticity\\ of Output\\ wrt K} &
\scell{Change in \\Elasticity\\ of Output\\ wrt L} &
\scell{Change in \\Elasticity\\ of Output\\ wrt H} &
\scell{Change in \\ Growth Rate\\ of K} &
\scell{Change in\\ Growth Rate \\ of L} &
\scell{Change in \\Growth Rate\\ of H} &
\scell{dy/dx oil} &
\scell{Local\\ Technical\\ Process} \\ \hline
Canada  & -1.4& -0.22&  0.18&   -0.08   &-0.36  &-0.21  &-0.14  &-0.31& -0.24\\
France& -3.1&   -0.44   &-0.02  &-0.09& -0.70&  -0.65&  -0.01&  -0.43&  -0.80\\
W. Germany& -2.9&   -0.44&  -0.06   &-0.04& -0.90&  -0.30&  0.12&   -0.42&  -0.87\\
Italy&  -2.4&   -0.40&  0.01&   -0.07&  -0.82&  0.54&   0.06&   -0.94&  -0.75\\
Japan&  -5.6&   -0.89&  0.07&   -0.11&  -1.25&  -0.28&  -0.17&  -1.78&  -1.15\\
U.K.&   -2.1&   -0.09   &-0.01& -0.03&  0.08&   -0.59&  0.04&   -0.95&  -0.52\\
U.S.&   -1.5&   -0.19&  0.15&   -0.06&  -0.52&  0.18&   0.00&   -0.61&  -0.41\\
\hline
\scell{Period 3 vs. \\ Period 2} &
\scell{Difference\\ in Growth\\ Rate} &
\scell{Change in \\Elasticity\\ of Output\\ wrt K} &
\scell{Change in \\Elasticity\\ of Output\\ wrt L} &
\scell{Change in \\Elasticity\\ of Output\\ wrt H} &
\scell{Change in \\ Growth Rate\\ of K} &
\scell{Change in\\ Growth Rate \\ of L} &
\scell{Change in \\Growth Rate\\ of H} &
\scell{dy/dx oil} &
\scell{Local\\ Technical\\ Process} \\ \hline
Canada &    -0.6&   -0.16&  0.14&   -0.07&  -0.40&  -0.14&  -0.03&  0.31&   -0.26\\
France& -0.4&   -0.30&  -0.02&  -0.08&  -0.18&  0.69&   -0.07&  0.43&   -0.82\\
W. Germany& 1.1&    -0.17&  0.00&   -0.03&  0.10&   1.29&   -0.07&  0.42&   -0.47\\
Italy&  -0.8&   -0.29&  0.05&   -0.08&  -0.25&  -0.14&  -0.10&  0.94&   -0.90\\
Japan&  -1.1&   -0.58&  0.01&   -0.05&  -0.50&  -0.47&  -0.13&  1.78&   -1.19\\
U.K.&   1.0&    -0.16&  -0.01&  -0.04&  0.19&   0.76&   -0.03&  0.95&   -0.64\\
U.S.&   -0.1&   -0.12&  0.13&   -0.05&  0.06&   -0.31&  -0.07&  0.61&   -0.35\\

 \hline
 \hline


\end{tabular}\medskip

![在此处输入图片描述

谢谢你!

答案1

您应该使用booktabs更好的规则,尤其siunitx是数字表。

我猜测了 的一个可能的定义\scell

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

\newcommand{\scell}[1]{{\begin{tabular}[t]{@{}c@{}}#1\end{tabular}}}

\begin{document}

\begin{sidewaystable}
\footnotesize

\caption{Estimated Production Elasticities, Returns to Scale, and Rates of Techni Variables)}
\label{t52}

\begin{tabular*}{\textwidth}{
  @{\extracolsep{\fill}}
  l
  S[table-format=-1.1]
  *{8}{S[table-format=-1.2]}
  @{}
}
\toprule
\scell{Period 2 vs. \\ Period 1} &
\scell{Difference\\ in Growth\\ Rate} &
\scell{Change in \\Elasticity\\ of Output\\ wrt K} &
\scell{Change in \\Elasticity\\ of Output\\ wrt L} &
\scell{Change in \\Elasticity\\ of Output\\ wrt H} &
\scell{Change in \\ Growth Rate\\ of K} &
\scell{Change in\\ Growth Rate \\ of L} &
\scell{Change in \\Growth Rate\\ of H} &
\scell{dy/dx \\ oil} &
\scell{Local\\ Technical\\ Process} \\
\midrule
Canada     & -1.4 & -0.22 &  0.18 & -0.08 & -0.36 & -0.21 & -0.14 & -0.31 & -0.24\\
France     & -3.1 & -0.44 & -0.02 & -0.09 & -0.70 & -0.65 & -0.01 & -0.43 & -0.80\\
W. Germany & -2.9 & -0.44 & -0.06 & -0.04 & -0.90 & -0.30 &  0.12 & -0.42 & -0.87\\
Italy      & -2.4 & -0.40 &  0.01 & -0.07 & -0.82 &  0.54 &  0.06 & -0.94 & -0.75\\
Japan      & -5.6 & -0.89 &  0.07 & -0.11 & -1.25 & -0.28 & -0.17 & -1.78 & -1.15\\
U.K.       & -2.1 & -0.09 & -0.01 & -0.03 &  0.08 & -0.59 &  0.04 & -0.95 & -0.52\\
U.S.       & -1.5 & -0.19 &  0.15 & -0.06 & -0.52 &  0.18 &  0.00 & -0.61 & -0.41\\
\midrule
\scell{Period 3 vs. \\ Period 2} &
\scell{Difference\\ in Growth\\ Rate} &
\scell{Change in \\Elasticity\\ of Output\\ wrt K} &
\scell{Change in \\Elasticity\\ of Output\\ wrt L} &
\scell{Change in \\Elasticity\\ of Output\\ wrt H} &
\scell{Change in \\ Growth Rate\\ of K} &
\scell{Change in\\ Growth Rate \\ of L} &
\scell{Change in \\Growth Rate\\ of H} &
\scell{dy/dx \\ oil} &
\scell{Local\\ Technical\\ Process} \\ \hline
Canada     & -0.6 & -0.16 &  0.14 & -0.07 & -0.40 & -0.14 & -0.03 &  0.31 & -0.26\\
France     & -0.4 & -0.30 & -0.02 & -0.08 & -0.18 &  0.69 & -0.07 &  0.43 & -0.82\\
W. Germany &  1.1 & -0.17 &  0.00 & -0.03 &  0.10 &  1.29 & -0.07 &  0.42 & -0.47\\
Italy      & -0.8 & -0.29 &  0.05 & -0.08 & -0.25 & -0.14 & -0.10 &  0.94 & -0.90\\
Japan      & -1.1 & -0.58 &  0.01 & -0.05 & -0.50 & -0.47 & -0.13 &  1.78 & -1.19\\
U.K.       &  1.0 & -0.16 & -0.01 & -0.04 &  0.19 &  0.76 & -0.03 &  0.95 & -0.64\\
U.S.       & -0.1 & -0.12 &  0.13 & -0.05 &  0.06 & -0.31 & -0.07 &  0.61 & -0.35\\
\bottomrule
\end{tabular*}

\end{sidewaystable}

\end{document}

在此处输入图片描述

答案2

作为起点使用@egreg 答案...使用两个附加包:makecellmultirow稍微不同的表格设计:

\documentclass{article}
\usepackage{rotating}
\usepackage{booktabs, makecell, multirow}
\usepackage{siunitx}

\begin{document}
\begin{sidewaystable}
    \centering
\caption{Estimated Production Elasticities, Returns to Scale, and Rates of Techni Variables}
\label{t52}
    \renewcommand{\arraystretch}{1.4}
    \sisetup{table-format=-1.2, table-column-width=4em}
\begin{tabular}{ @{} l *{9}{S}  @{}}
    \toprule
\multirow{2.4}{*}{State}   
    &   
{\multirow{2.4}{*}{\makecell{Difference\\ in Growth\\ Rate}}} 
        &   \multicolumn{3}{c}{Change in Elasticity of Output}
            &   \multicolumn{3}{c}{Change in Growth Rate}
                &   {\multirow{2.4}{*}{\makecell{dy/dx\\ oil}}} 
                    &   {\multirow{2.4}{*}{\makecell{Local\\ Technical\\ Process}}}    \\
    \cmidrule(lr){3-5}\cmidrule(lr){6-8}
    &   &   {wrt K}
            &   {wrt L} 
                &   {wrt H} 
                    &   {of K}
                        &   {of L}
                            &   {of H}
                                &   &           \\
    \midrule
\multicolumn{10}{c}{Period 2 versus Period 1}   \\ 
    \midrule
Canada      & -1.4  & -0.22 &  0.18 & -0.08 & -0.36 & -0.21 & -0.14 & -0.31 & -0.24\\
France      & -3.1  & -0.44 & -0.02 & -0.09 & -0.70 & -0.65 & -0.01 & -0.43 & -0.80\\
W. Germany  & -2.9  & -0.44 & -0.06 & -0.04 & -0.90 & -0.30 &  0.12 & -0.42 & -0.87\\
Italy       & -2.4  & -0.40 &  0.01 & -0.07 & -0.82 &  0.54 &  0.06 & -0.94 & -0.75\\
Japan       & -5.6  & -0.89 &  0.07 & -0.11 & -1.25 & -0.28 & -0.17 & -1.78 & -1.15\\
U.K.        & -2.1  & -0.09 & -0.01 & -0.03 &  0.08 & -0.59 &  0.04 & -0.95 & -0.52\\
U.S.        & -1.5  & -0.19 &  0.15 & -0.06 & -0.52 &  0.18 &  0.00 & -0.61 & -0.41\\
    \midrule
\multicolumn{10}{c}{Period 3 versus Period 2}   \\
    \midrule
Canada      & -0.6  & -0.16 &  0.14 & -0.07 & -0.40 & -0.14 & -0.03 &  0.31 & -0.26\\
France      & -0.4  & -0.30 & -0.02 & -0.08 & -0.18 &  0.69 & -0.07 &  0.43 & -0.82\\
W. Germany  &  1.1  & -0.17 &  0.00 & -0.03 &  0.10 &  1.29 & -0.07 &  0.42 & -0.47\\
Italy       & -0.8  & -0.29 &  0.05 & -0.08 & -0.25 & -0.14 & -0.10 &  0.94 & -0.90\\
Japan       & -1.1  & -0.58 &  0.01 & -0.05 & -0.50 & -0.47 & -0.13 &  1.78 & -1.19\\
U.K.        &  1.0  & -0.16 & -0.01 & -0.04 &  0.19 &  0.76 & -0.03 &  0.95 & -0.64\\
U.S.        & -0.1  & -0.12 &  0.13 & -0.05 &  0.06 & -0.31 & -0.07 &  0.61 & -0.35\\
    \bottomrule
\end{tabular}
    \end{sidewaystable}
\end{document}

在此处输入图片描述

相关内容