Take the 2-minute tour ×
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 am using the p attribute so I can enable text wrapping. How can I get the second column, Numeric Rating to be center justified?

\documentclass{article}
\usepackage{multirow}
\usepackage[english]{babel}
\usepackage{booktabs}
\begin{document}
\begin{table}[H]
\centering
\begin{tabular}{ p{2.75cm} p{2.75cm} p{2.75cm} p{7cm} }
\toprule
Acceptability &Numeric Rating & General Rating & Improvement Implication\\ \hline
\multirow{3}{2.75cm}{Acceptable and Satisfactory} & 10 & Excellent & No obvious room for improvement \\
 & 9 & Very Good & Minor improvement possible, but not required \\
 & 8 & Good & Some improvement possible, but not required \\ \hline
\multirow{3}{2.75cm}{Acceptable but Unsatisfactory} & 7 & Fair & Limited Improvement requested \\
 & 6 & Somewhat Poor & Significant improvement requested \\
 & 5 & Poor & Major improvement requested \\ \hline
\multirow{4}{2.75cm}{Unacceptable} & 4 & Very Poor & Some improvement mandatory \\
 & 3 & Bad & Significant improvement mandatory \\
 & 2 & Very Bad & Major improvement mandatory \\
 & 1 & Extremely Bad & Extensive improvement or major design changes are mandatory\\ \hline
 & 0 & \multicolumn{2}{l}{Can't answer question, e.g., don't remember} \\
\bottomrule
\end{tabular}
\caption[General Rating Scale]{General Rating Scale}
\label{tab:genRating}
\end{table}
\end{document}
share|improve this question
1  
Nice that you post a minimal example! I would just like to note that it's not compilable, \usepackage{booktabs} is missing. –  Stefan Kottwitz Nov 19 '10 at 19:37
    
@Stefan, whoops forget to copy that over –  Elpezmuerto Nov 19 '10 at 19:39
1  
thanks for correction! A good minimal example deserves a solution, so I checked it out. ;) –  Stefan Kottwitz Nov 19 '10 at 19:50

1 Answer 1

up vote 5 down vote accepted

Load the array package, it provides a shortcut > for inserting commands into the column definition, this way you could insert \centering:

\usepackage{array}
\begin{tabular}{ p{2.75cm}>{\centering\arraybackslash}p{2.75cm} p{2.75cm} p{7cm} }
...

\arraybackslash is a small helper macro which restores the meaning of \\ as \tabularnewline which might otherwise be destroyed by \centering.

share|improve this answer
    
Perfect answer, thanks! –  Elpezmuerto Nov 19 '10 at 19:53

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.