2

I'm having some difficulties with the table below. I don't understand why the text in the column 4 is not vertically centered. Also, the title of this column is not horizontally aligned with the titles of the 2nd and 3rd columns. Finally, the vertical line between the first and the second column is not continuous.

\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{table}
\centering
\footnotesize
\begin{tabular}{C{0.70in}| C{1.60in} C{1.60in} C{1.60in}}
                  & \textbf{Column 2}    & \textbf{Column 3}   & \textbf{Column 4}   \\[1ex] \toprule
 \textbf{Row 2}   & text text text text  & text text text text & text text text text \\[4ex] \midrule
 \textbf{Row 3}   & text text text text  & text text text text & text text text text \\[4ex] \bottomrule
 \end{tabular}
 \end{table}

Many thanks in advance for your help :) Beth.

  • Vertical lines and booktabs are not compatible, that's why the line is not continuous. If you delete the [1ex] etc. the alignment will work. – rtzll Feb 27 '13 at 10:07
2

Please always post complete documents showing all packages used.

As noted in the comments you should not use booktabs if you are using vertical rules, also the struts added by \\[...] interfere with m cells in ways that usually are not desired. One possibility is to insert an empty last column to hold these struts:

enter image description here

\documentclass{article}

\usepackage{array,booktabs}

\begin{document}

\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{table}
\centering
\footnotesize
\begin{tabular}{C{0.70in}| C{1.60in} C{1.60in} C{1.60in}}
                  & \textbf{Column 2}    & \textbf{Column 3}   & \textbf{Column 4}   \\[1ex] \toprule
 \textbf{Row 2}   & text text text text  & text text text text & text text text text \\[4ex] \midrule
 \textbf{Row 3}   & text text text text  & text text text text & text text text text \\[4ex] \bottomrule
 \end{tabular}

\bigskip

\begin{tabular}{C{0.70in}| C{1.60in} C{1.60in} C{1.60in}@{}m{0pt}}
                  & \textbf{Column 2}    & \textbf{Column 3}   & \textbf{Column 4}   &\\[1ex] \hline
 \textbf{Row 2}   & text text text text  & text text text text & text text text text &\\[4ex] \hline
 \textbf{Row 3}   & text text text text  & text text text text & text text text text &\\[4ex] \hline
 \end{tabular}
 \end{table}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy