0

I am trying to properly align to the left a few variables names in a latex table. These variables names are within a multirowcell as the table is big (16 columns+).

I have tried with \shortstack[l] which works very well for the first variable (the one in bold). However this works less well for the second variable "VARIABLE LA DEUXIEME IMPORTANTE". Same for "Variable Deux" and "Variable Trois". Does anyone have a fix?

enter image description here

Thank you!

\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 Answer 1

1

The documentation tells you that there are two optional arguments for \multirowcell. Since the alignment is specified in the second optional argument, you will need to specify both:

\multirowcell{2}[0pt][l]{Variable\\Deux}
1
  • Indeed. Thank you very much! Feb 11, 2021 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .