我真的很努力地想自己做这件事,但总是失败。请提出任何建议。这是我想要的桌子的图片
这是迄今为止我尝试过的。
\begin{table}\centering
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{cccccccc}
\toprule
Variables & AGR & CONST & ENRG & HH & MANF & MIN & TRSM \\
\midrule
Constant & 4.1189***& 2.3716***& 4.7062***& 2.6683 ***&2.746***& 3.432***& 3.472*** \\
& \multirow{2}{*}{(5.67)}& \multirow{2}{*}{(5.37)}& \multirow{2}{*}{(5.96)}& \multirow{2}{*}{(9.22)}& \multirow{2}{*}{(5.17)}& \multirow{2}{*}{(8.08)}& \multirow{2}{*}{(8.46)}\\
\addlinespace
\addlinespace
NPL (-1) & 0.505***& 0.61*** & 0.046 & -0.171***&0.633***&0.691***& 0.108*** \\
& \multirow{2}{*}{(1.422)}& \multirow{2}{*}{(1.175)}& \multirow{2}{*}{(2.118)}& \multirow{2}{*}{(-2.363)}& \multirow{2}{*}{(2.118)}& \multirow{2}{*}{(3.243)}& \multirow{2}{*}{(2.852)}\\
\addlinespace
\addlinespace
\addlinespace
Specialization:Log (Loans-to-Assets) & 0.505***& 0.533***& 0.513***& 0.539***&0.519***& 0.512***& 0.542*** \\
& \multirow{2}{*}{(18.16)}& \multirow{2}{*}{(18.32)}& \multirow{2}{*}{(18.45)}& \multirow{2}{*}{(18.44)}& \multirow{2}{*}{(18.49)}& \multirow{2}{*}{(18.24)}& \multirow{2}{*}{(18.25)}\\
\addlinespace
\addlinespace
\addlinespace
Credit quality:Log (Loan loss provision-to-total loans) & 0.1113 & 2123.17 & \\
\bottomrule
\end{tabular}
\end{adjustbox}
\caption{This table shows}\label{eval_table}
\end{table}
答案1
以下解决方案试图避免您发布的屏幕截图中显示的表格中相当可疑的设计元素,我在之前的评论中提到过这些元素。
下表的 LaTeX 代码
只在需要强调的地方使用斜体,而不使用大胆的一点儿;
不使用垂直线,而是使用少量但间距适当的水平线,使表格整体呈现开放和“吸引人”的外观——请注意,空白在创建视觉“屏障”方面可以与实线一样有效;
使用该
dcolumn
包将七个数据列中的所有数字对齐到各自的小数点标记上;不要无缘无故地改变字体大小;
不会不必要地插入垂直空白,从而避免产生无意义的视觉间隙。
\documentclass[times]{elsarticle} % as per the OP's earlier postings
\usepackage{booktabs} % for well-spaced horizontal lines
\usepackage{dcolumn} % to align numbers on decimal markers
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\begin{document}
\begin{table}[ht!]
\footnotesize
\setlength\tabcolsep{0pt} % make LaTeX figure out intercol. space
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l *{7}{d{2.5}} }
\toprule
Variables & \mc{AGR} & \mc{CONST} & \mc{ENRG}
& \mc{HH} & \mc{MANF} & \mc{MIN} & \mc{TRSM}\\
\midrule
Constant & 4.119^{***} & 2.372^{***} & 4.706^{***} & 2.668^{***} & 2.746^{***} & 3.432^{***} & 3.472^{***}\\
& (5.57) & (5.37) \\
\addlinespace
NPL($-1$) & 0.520^{***} & \\
& (18.16) & \\
\addlinespace
\emph{Specialization} \\
Log (Loans-to-Assets) & 0.505^{***}\\
& (1.422) \\
\addlinespace
\emph{Credit Quality} \\
Log (Loan loss provi- & 0.361^{***} & \\
\quad sions to total loans) & (11.47) & \\
\addlinespace
Log (Diversification) & -0.022 & \\
& (-0.24)& \\
\addlinespace
\emph{Profitability} & \\
Log (Return on Assets) & -0.091^{***} & \\
& (-2.26) & \\
\addlinespace
GDP \hfill Mov(2) & -0.039^{**} & -0.028^{**} & -0.109^{***}\\
& (2.75) & (-2.31) & (-3.51) \\
\addlinespace
\hfill Mov(3) & & & & -0.061^{***} & & -0.021^{**} & \\
& & & & (-4.60) & & (-1.03) & \\
\addlinespace
\hfill Mov(4) & & & & & -0.044^{**} & & -0.045^{***}\\
& & & & & (1.65) & & (-3.42)\\
\bottomrule
\end{tabular*}
\end{table}
\end{document}
答案2
比提供的解决方案更复杂的解决方案的一个例子米科.... 除了使用包之外,booktabs
它还使用包tabularx
threeparttable
和siunitx
:
编辑:
在第一个答案版本中,我忘记了括号中的负数。现在已更正:
\documentclass[times]{elsarticle} % based on @Mico answer
\usepackage{booktabs, tabularx, threeparttable}
\usepackage{siunitx}
\newcommand\mcx[1]{%
\multicolumn{1}{>{\centering\arraybackslash}X}{#1}} % for columns' headers
\begin{document}
\begin{table}[ht!]
\sisetup{input-symbols={( - )},
table-align-text-post=false,
parse-numbers=false, % <---
table-format=-2.5 % <---
}
\linespread{0.9}
\begin{threeparttable}[htb]
\caption{Table title}
\label{tab:statistic}
\small
\setlength\tabcolsep{3pt}
\begin{tabularx}{\linewidth}{@{} l *{7}{S} @{}}
\toprule
Variables & \mcx{AGR} & \mcx{CONST} & \mcx{ENRG}
& \mcx{HH} & \mcx{MANF} & \mcx{MIN} & \mcx{TRSM} \\
\midrule
Constant & 4.1189\tnote{***} & 2.3716 \tnote{***} & 4.7062\tnote{***}
& 2.6683\tnote{***} & 2.746\tnote{***} & 3.432\tnote{***}
& 3.472\tnote{***} \\
& (5.67) & (5.37) & (5.96)
& (9.22) & (5.17) & (8.08)
& (8.46) \\
\addlinespace
NPL $(-1)$ & 0.505\tnote{***} & 0.61\tnote{***} & 0.046
& -0.171\tnote{***} & 0.633\tnote{***} & 0.691\tnote{***}
& 0.108\tnote{***} \\
& (1.422) & (1.175) & (2.118)
& (2.363) & (2.118) & (3.243)
& (2.852) \\
\midrule
GDP:\quad Mov(2)
& -0.039\tnote{**} & -0.028\tnote{**} & -0.109\tnote{***}
& & & & \\
& (2.75) & (-2.31) & (-3.51)
& & & & \\
\addlinespace
\hfill Mov(3)
& & & & -0.061\tnote{***} & & -0.021\tnote{**} & \\
& & & & (-4.60) & & (-1.03) & \\
\addlinespace
\hfill Mov(4)
& & & & & -0.044\tnote{**} & & -0.045\tnote{***} \\
& & & & & (1.65) & & (-3.42) \\
\bottomrule
\end{tabularx}
\begin{tablenotes}[para]
\item[*] explanation what is *;
\item[**] explanation what is **;
\item[**] explanation what is ***;
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
(红线表示文字边框)