# How to place the text top left in a table cell

We can use

\renewcommand{\arraystretch}{2}

to increase the height of rows. The text, however, is just in the center.

How can we simply put it on the top-left, as in second and third columns in the picture?

Note : this is drawn by Tikz. I want it with tabular if possible.

The easiest solution is to modify the contents of the cell, The first solutions added a "strut" extending downward, while the second shows a more general approach using \raisebox.

\documentclass{article}
\begin{document}
\begin{tabular}{|c|c|c|}
\hline
\rule[-2\normalbaselineskip]{0pt}{3\normalbaselineskip}% strut
a) T.Insert(8) & b) T.Insert(12) & c) T.Insert(10) \\
\hline
\end{tabular}

\bigskip
\begin{tabular}{|c|c|c|}
\hline
\raisebox{\normalbaselineskip}{a) T.Insert(8)} &
\raisebox{0pt}[2\normalbaselineskip][1.6\normalbaselineskip]{b) T.Insert(12)} &% baseline here
\raisebox{-\normalbaselineskip}{c) T.Insert(10)} \\
\hline
\end{tabular}
\end{document}


• It doesn't look like a real solution. It looks like a workaround. Could we just say that in normal circumstances there is no easy way to align cell content top-left? You always have to use typographic "tricks". Isn't it that way? – buhtz Jul 10 '16 at 7:17
• @bulitz - All of LaTeX is based on typographical tricks. There is strut automatically added whose size is determined by \arraystretch. If you want to modify the source code you could have a real solution. But in the end, both would be doing the exact same thing. – John Kormylo Jul 10 '16 at 15:48