Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
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. – Christian R. Feb 27 at 10:07

1 Answer

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.