[Tex/LaTex] Vertically align the cell of a table with the baseline of surrounding text

tablesvertical alignment

I have a table like this:

\begin{tabular}[b]{c}
A \\
B \\
C \\
D \\
\end{tabular}E

The code above places "D" and "E" on the same baseline, no matter what size any of the letters are.

Without changing "E" (I can't make changes to this text), how can I adjust the table, such that "C" and "E" are on the same baseline, no matter what size any of the letters are?

Best Answer

Assuming no \hline and that the table cells have "normal" size, this should work (the setting of \arraystretch is just to show that it can be done):

\documentclass{article}
\newsavebox{\lowertabularbox}
\newenvironment{lowertabular}[1][0]
  {\newcommand{\lowertabulararg}{#1}\begin{lrbox}{\lowertabularbox}
   \begin{tabular}[b]}
  {\end{tabular}\end{lrbox}%
   \raisebox{-\dimexpr\arraystretch\baselineskip*\lowertabulararg\relax}{\usebox{\lowertabularbox}}}

\begin{document}
\renewcommand{\arraystretch}{1.4}
\begin{lowertabular}[0]{c}
A \\
B \\
C \\
D \\
\end{lowertabular}E
\begin{lowertabular}[1]{c}
A \\
B \\
C \\
D \\
\end{lowertabular}E
\begin{lowertabular}[2]{c}
A \\
B \\
C \\
D \\
\end{lowertabular}E
\begin{lowertabular}[3]{c}
A \\
B \\
C \\
D \\
\end{lowertabular}E

some text below to ensure that all is going well
\end{document}

enter image description here

Related Question