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 want to vertically center the "Characteristic" heading in its respective cell?

enter image description here

\documentclass[a4paper,12pt]{article}

\usepackage{booktabs} %for top, middle and bottomline
\usepackage{multirow} %multi column and row spanning
\usepackage{multicol}
\usepackage{graphicx}

\begin{document}

\begin{multicols}{2}

\subsection*{Results}


\resizebox{\columnwidth}{!}{%
\begin{tabular}{@{} l c c @{}}
\toprule
Characteristic & \multicolumn{2}{c}{Result}\\
 \cmidrule{2-3}
 & Seaweed isolate & Coral isolate \\
 \midrule
Cell shape & Rod & Rod\\
Gram stain & $-$ & $-$\\
Oxidase & $+$ & $-$\\
Catalase & $+$ & $-$\\
MSA & Growth & No growth\\
Anaerobic & Growth (weak) & No growth\\
Motility & & \\
Indole production & & \\
Hugh \& Leifsons & & \\
\bottomrule
\end{tabular}
}


\end{multicols}

\end{document}
share|improve this question
    
Can you please learn to post minimal examples (and have your image actually match the code you post.) The code above doesn't compile (\usepackage{graphicx} is missing) plus it has many packages loaded that are not relevant to show the problem you are having. People will be much more willing to help you if they don't have to wade through loads of irrelevant (and non-working) code. –  Alan Munn May 12 '11 at 20:07
    
All better. I've added \usepackage{graphicx} and taken out the irrelevant packages now. –  ptrcao May 13 '11 at 9:54

1 Answer 1

up vote 5 down vote accepted

You can do it manually, using \raisebox, or you can use the \multirow command from the homonymous package (although, as egreg has mentioned in a comment, it's better not to shift the heading):

\documentclass[a4paper,12pt]{article}
\usepackage{booktabs} %for top, middle and bottomline
\usepackage{multirow} %multi column and row spanning
\usepackage{graphicx}
\usepackage{multicol}

\begin{document}

\begin{multicols}{2}

\subsection*{Results}

\resizebox{\columnwidth}{!}{%
\begin{tabular}{@{} l c c @{}}
\toprule
\multirow{2}{*}{Characteristic} & \multicolumn{2}{c}{Result}\\
 \cmidrule{2-3}
 & Seaweed isolate & Coral isolate \\
 \midrule
Cell shape & Rod & Rod\\
Gram stain & $-$ & $-$\\
Oxidase & $+$ & $-$\\
Catalase & $+$ & $-$\\
MSA & Growth & No growth\\
Anaerobic & Growth (weak) & No growth\\
Motility & & \\
Indole production & & \\
Hugh \& Leifsons & & \\
\bottomrule
\end{tabular}
}


\end{multicols}

\end{document}
share|improve this answer
2  
Or you don't. And it's better, in my opinion. –  egreg May 12 '11 at 20:06
    
@egreg: I agree. It's better not to shift the heading. –  Gonzalo Medina May 12 '11 at 20:08
    
You'll be pleased to hear, I settled on not shifting the heading after all. –  ptrcao Jun 18 '11 at 12:49

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.