[Tex/LaTex] vertically align text in table in LaTeX

tablesvertical alignment

Probably a straightforward problem. Why is the final column not center aligned vertically?

enter image description here

Here is the code I'm using:

\documentclass{article}
\usepackage{array}

\begin{document}

\begin{table}[h]
    \begin{center}
      \caption{Data Units, Sources, and Dates}

    \begin{tabular}{| >{\centering\arraybackslash}m{1in} | >{\centering\arraybackslash}m{1in} | >{\centering\arraybackslash}m{1in} | >{\centering\arraybackslash}m{1in} |}

    \hline

    {\bf Variable} & {\bf Dates} & {\bf Units} & {\bf Source}  \\[2ex] \hline
    {\bf Nominal Physical Capital Stock} & 1950-1990 & Billions  US\$ & Nehru and Dhareshwar (1993) \\[0ex] \hline
    {\bf Total Population} & 1950-1990 & Billions & Nehru and Dhareshwar (1993) \\[0ex] \hline
    {\bf Nominal GDP} & 1950-1990 & Billions  US\$ & PWT \\[5ex] \hline
    {\bf Real GDP per capita} & 1950-1990 & 2005 US\$ per capita & PWT \\[5ex] \hline

  \end{tabular}

  \label{tabular:UKJPNdata}
  \end{center}
\end{table}


\end{document}

Best Answer

Since the use of \\[<len>] is the cause of the problem, here is a slightly different (more suggestive) solution:

enter image description here

\documentclass{article}
\usepackage{array,booktabs}% http://ctan.org/pkg/{array,booktabs}

\begin{document}

\begin{table}[ht]
  \centering
  \caption{Data Units, Sources, and Dates}
  \renewcommand{\arraystretch}{1.5}% Spread rows out...
  \begin{tabular}{>{\centering\bfseries}m{1in} >{\centering}m{1in} >{\centering}m{1in} >{\centering\arraybackslash}m{1in}}
    \toprule
    Variable & \textbf{Dates} & \textbf{Units} & \textbf{Source} \\
    \midrule
    Nominal Physical Capital Stock & 1950-1990 & Billions  US\$ & Nehru and Dhareshwar (1993) \\
    Total Population & 1950-1990 & Billions & Nehru and Dhareshwar (1993) \\
    Nominal GDP & 1950-1990 & Billions  US\$ & PWT \\
    Real GDP per capita & 1950-1990 & 2005 US\$ per capita & PWT \\
    \bottomrule
  \end{tabular}
\end{table}

\end{document}

It's best to be consistent. As such, updating \arraystretch spreads the rows out evenly. I've also taken the liberty of using booktabs's suggestions (limiting horizontal rules and never using vertical rules). The presentation looks cleaner and more professional.

Related Question