# Text Wrapping in Tables and Vertical Alignment

I am attempting to adjust my headers such that they are centered horizontally and vertically within the cell, and that the last cell specifically breaks at that point. This was my best solution however when I send it to others, it does not come out correctly. There must be a better way.

\begin{center}
\textbf{Table II}
\textbf{Title \medskip }
\begin{tabular}{|c|c|c|c|}
\hline
\multirow{2}{*}{Number of experts}&\multirow{2}{*}{Equilibrium threshold} & \multirow{2}{*}{DM's payoff}& \\ [-12pt]
& & & \shortstack{DM's outside option\\ supporting $t^*>0$}\\[-2pt] \hline
1 & 0.484 & 0.691 & $r\in[0,0.484]$ \\ \hline
2 & 0.136 & 0.735 & $r\in[0,0.588]$ \\ \hline
3 & 0.021 & 0.657 & $r\in[0,0.633]$ \\ \hline
4 & 0.001 & 0.568 & $r\in[0,0.567]$ \\ \hline
5 or more & 0 & 0.5 & $r\in[0,0.5]$ \\ \hline
\end{tabular}
\end{center}


I would like to recommend you give your table a much more "open" look. To achieve this objective, get rid of all vertical lines and most horizontal lines; use the line-drawing macros of the booktabs package for the remaining horizontal lines. Also, instead of using a \multirow hack, consider loading the tabularx package and using a centered version of that package's X column type for columns 2 and 4 -- the ones where automatic line breaking is required -- and c for columns 1 and 3.

\documentclass{article}

\usepackage{tabularx,ragged2e,booktabs}
\newcolumntype{C}{>{\Centering\arraybackslash}X}

\usepackage[font=bf]{caption}
\renewcommand\thetable{\Roman{table}}

\begin{document}
\setcounter{table}{1} % just for this example

\begin{table}
\caption{Title}
\begin{tabularx}{\textwidth}{@{}cCcC@{}}
\toprule
Number of experts & Equilibrium threshold &
DM's payoff & DM's outside option supporting $t^*>0$\\
\midrule
1         & 0.484 & 0.691 & $r\in[0,0.484]$ \\
2         & 0.136 & 0.735 & $r\in[0,0.588]$ \\
3         & 0.021 & 0.657 & $r\in[0,0.633]$ \\
4         & 0.001 & 0.568 & $r\in[0,0.567]$ \\
5 or more & 0\phantom{.000} & 0.5\phantom{00} & $r\in[0,0.5]\phantom{00}$ \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}


From your code snipped is impossible to say anything why others who compile your code get different result as you. Well also table, which you show in question is not generated from your code. See, if the following MWE gives beter results at you as well as at others:

\documentclass{article}
\usepackage[labelfont=bf,labelsep=newline]{caption}
\usepackage{makecell}

\begin{document}
\begin{table}
\caption{Title}
\begin{tabular}{|c|c|c|c|}
\hline
supporting $t^*>0$}   \\
\hline
1 & 0.484 & 0.691 & $r\in[0,0.484]$ \\ \hline
2 & 0.136 & 0.735 & $r\in[0,0.588]$ \\ \hline
3 & 0.021 & 0.657 & $r\in[0,0.633]$ \\ \hline
4 & 0.001 & 0.568 & $r\in[0,0.567]$ \\ \hline
5 or more & 0 & 0.5 & $r\in[0,0.5]$ \\ \hline
\end{tabular}
\end{table}
\end{document}


Of course, better (professional) looks of table you obtain by use of booktabs package (see Mico answer).

This solution puts the multiline entry into a \parbox. The only problem is having to guess or compute the width of the box.

Note: The \strut was purely cosmetic, to add a little space at the bottom of the \parbox.

\documentclass{article}
\newlength{\tempwidth}
\begin{document}
\begin{center}
\textbf{Table II}
\textbf{Title \medskip }
\settowidth{\tempwidth}{DM's outside option}% compute parbox width
\begin{tabular}{|c|c|c|c|}
\hline
Number of experts & Equilibrium threshold & DM's payoff
& \parbox[t]{\tempwidth}{\centering DM's outside option supporting $t^*>0$\strut} \\ \hline
1 & 0.484 & 0.691 & $r\in[0,0.484]$ \\ \hline
2 & 0.136 & 0.735 & $r\in[0,0.588]$ \\ \hline
3 & 0.021 & 0.657 & $r\in[0,0.633]$ \\ \hline
4 & 0.001 & 0.568 & $r\in[0,0.567]$ \\ \hline
5 or more & 0 & 0.5 & $r\in[0,0.5]$ \\ \hline
\end{tabular}
\end{center}
\end{document}