[Tex/LaTex] \shortstack and vertical aligment in table

tablesvertical alignment

\documentclass{report}
\usepackage{lipsum}
\begin{document}
\begin{tabular}{cp{4cm}}
\hline
\shortstack{A\\B\\C\\D} & \lipsum[1] \\
\hline
\end{tabular}
\end{document}

Results in :

------------------------------------
A
B
C
D    Lorem ipsum dolor sit amet,
     consectetuer adipiscing elit.
     Ut purus elit, vestibulum
     ut, placerat ac, adipiscing
     vitae, felis. Curabitur
     dictum gravida mauris. Nam
------------------------------------

While I'd like to achieve:

------------------------------------
A    Lorem ipsum dolor sit amet,
B    consectetuer adipiscing elit.
C    Ut purus elit, vestibulum
D    ut, placerat ac, adipiscing
     vitae, felis. Curabitur
     dictum gravida mauris. Nam
------------------------------------

How to do this using \shortstack ?

P.S. I've found solution using \matrix \ShortStack Align – I am curious if it's possible to do with \shortstack ?

Best Answer

The important thing is to trim off the depth of the "substack"

\documentclass{report}
\usepackage{amsmath} % for \smash[b]{...}
\usepackage{lipsum}

\newcommand{\blap}[1]{\smash[b]{\begin{tabular}[t]{@{}c@{}}#1\end{tabular}}}

\begin{document}

\begin{tabular}{cp{4cm}}
\hline
\blap{A\\B\\C\\D}
& \lipsum[1] \\
\hline
\end{tabular}

\end{document}

In the following picture, on the left is what results from my code, on the right with the other proposed one

enter image description here

\documentclass{article}

\usepackage{amsmath}

\newcommand{\blap}[1]{%
  \smash[b]{\begin{tabular}[t]{@{}c@{}}#1\end{tabular}}}

\begin{document}

\begin{tabular}{cp{4cm}}
\hline
\blap{A\\B\\C\\D}
&
some text to fill four lines
some text to fill four lines
some text to fill four lines
some text to fill four lines
some text to fill four lines
\\
\hline
\end{tabular}\qquad
\begin{tabular}{cp{4cm}}
\hline
\vbox to 0pt{\hbox{
\shortstack{A\\B\\C\\D}
}\vss}
&
some text to fill four lines
some text to fill four lines
some text to fill four lines
some text to fill four lines
some text to fill four lines
\\
\hline
\end{tabular}

\end{document}
Related Question