我正在尝试将 Latex 表中的几个变量名称正确对齐到左侧。由于表格很大(16 列以上),因此这些变量名称位于多行单元格内。
我尝试过,\shortstack[l]
对于第一个变量(粗体部分)效果很好。但是对于第二个变量“VARIABLE LA DEUXIEME IMPORTANTE”效果不太好。对于“Variable Deux”和“Variable Trois”也一样。有人有解决办法吗?
谢谢你!
\begin{scriptsize}
\renewcommand{\arraystretch}{1.2}
\begin{threeparttable}
\begin{tabular}{lp{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}p{.95cm}}
\hline\hline
\noalign{\smallskip} & \multicolumn{16}{c}{THIS IS OUTCOME VARIABLE}\\ \cmidrule{2-17}
&\multicolumn{1}{c}{(1)} &\multicolumn{1}{c}{(2)} &\multicolumn{1}{c}{(3)} &\multicolumn{1}{c}{(4)} &\multicolumn{1}{c}{(5)} &\multicolumn{1}{c}{(6)} &\multicolumn{1}{c}{(7)} &\multicolumn{1}{c}{(8)} &\multicolumn{1}{c}{(9)} &\multicolumn{1}{c}{(10)} &\multicolumn{1}{c}{(11)} &\multicolumn{1}{c}{(12)} &\multicolumn{1}{c}{(13)} &\multicolumn{1}{c}{(14)} &\multicolumn{1}{c}{(15)} &\multicolumn{1}{c}{(16)} \\
\hline
\multirowcell{3}{\shortstack[l]{\textbf{VARIABLE} \\ \textbf{LA PLUT} \\ \textbf{IMPORTANTE}}}& -11.432 & -12.717 & -11.468 & -12.480 & -11.374 & -12.493 & -11.447 & -12.729 & -11.450 & -12.682 & -11.461 & -12.772 & -10.931 & -11.732 & -10.810 & -11.294 \\
& [4.898]\sym{**} & [3.961]\sym{***}& [4.894]\sym{**} & [3.955]\sym{***}& [4.895]\sym{**} & [3.943]\sym{***}& [4.898]\sym{**} & [3.954]\sym{***}& [4.894]\sym{**} & [3.949]\sym{***}& [4.894]\sym{**} & [3.958]\sym{***}& [5.179]\sym{**} & [4.035]\sym{***}& [5.200]\sym{**} & [4.058]\sym{***}\\
& (3.951)\sym{***}& (5.604)\sym{**} & (3.956)\sym{***}& (5.596)\sym{**} & (3.946)\sym{***}& (5.579)\sym{**} & (3.956)\sym{***}& (5.595)\sym{**} & (3.951)\sym{***}& (5.587)\sym{**} & (3.948)\sym{***}& (5.601)\sym{**} & (4.137)\sym{***}& (5.709)\sym{**} & (4.152)\sym{***}& (5.742)\sym{**} \\
\multirowcell{3}{\shortstack[l]{VARIABLE \\ LA DEUXIEME \\ IMPORTANTE}}& 235 & & 235 & & 235 & & 235 & & 235 & & 235 & & 235 & & 235 & \\
& [5.000] & & [235] & & [235] & & [235] & & [235] & & [235] & & [235] & & [235] & \\
& (235) & & (235) & & (235) & & (235) & & (235) & & (235) & & (235) & & (235) & \\
\multirowcell{2}{Variable\\Deux}& & & & & -3.688 & -3.688 & & & & & & & & & 3.688 & -3.688 \\
& & & & & [3.688] & [3.688]\sym{**} & & & & & & & & & [3.688] & [3.688]\sym{**} \\
& & & & & (3.688) & (3.688) & & & & & & & & & (3.688) & (3.688) \\
Variable3 & & & & & & & & & 2.200 & 2.200 & & & & & 2.200 & 6.054 \\
& & & & & & & & & [2.200] & [2.200] & & & & & [2.200] & [2.200] \\
& & & & & & & & & (2.200) & (2.200) & & & & & (2.200) & (2.200) \\
\multirowcell{2}{Variable \\ Trois}& & & & & & & & & & & -4052 & -3.939 & & & -1.526 & -4.056 \\
& & & & & & & & & & & [4052] & [4052] & & & [4052] & [4052] \\
& & & & & & & & & & & (4052) & (4052) & & & (4052) & (4052) \\
& & & & & & & & & & & & & & & & \\
Nombre Obs & 1012 & 1012 & 1012 & 1012 & 1012 & 1012 & 1012 & 1012 & 1012 & 1012 & 1012 & 1012 & 1012 & 1012 & 1012 & 1012 \\
Moyenne& 225100 & 225100 & 225100 & 225100 & 225100 & 225100 & 225100 & 225100 & 225100 & 225100 & 225100 & 225100 & 225100 & 225100 & 225100 & 225100 \\
\hline
\end{tabular}
\begin{tablenotes}[para]
\textit{Notes}: HERE IS WHERE I WRITE THE NOTES
\end{tablenotes}
\end{threeparttable}
\end{scriptsize}
答案1
这文档告诉您有两个可选参数\multirowcell
。由于对齐是在第二个可选参数中指定的,因此您需要同时指定这两个参数:
\multirowcell{2}[0pt][l]{Variable\\Deux}