1

This question already has an answer here:

The following LaTeX code produces a table with one row and three columns. Each cell contains two short words word-wrapped so that one name is above the other. A design requirement of this table is the ability to force a word-wrap on a short sentence and control cell padding.

\documentclass[twoside]{report}
\usepackage{array}
\newcolumntype{M}{>{\centering\let\newline\\\arraybackslash\hspace{2pt}}m{1cm}}
\makeatletter
\begin{document}
        \begin{tabular}{|M|M|M|}
            \hline
            Sue Tim &  Sam Jake &  Eddy John  \\[3ex]
            \hline
        \end{tabular}
\end{document}

This code will produce the following output:

Image

The problem here is that the last cell is not vertically centered like the other two cells. Vertical padding is controlled by \\[3ex] on line 8 while horizontal padding is controlled by m{1cm} on line 3.

How can I modify this code so that the last cell looks like the first two cells?

marked as duplicate by David Carlisle tables Nov 24 '14 at 22:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.