3

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}
2
  • 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, 2011 at 20:07
  • All better. I've added \usepackage{graphicx} and taken out the irrelevant packages now.
    – ptrcao
    May 13, 2011 at 9:54

1 Answer 1

5

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}
3
  • 2
    Or you don't. And it's better, in my opinion.
    – egreg
    May 12, 2011 at 20:06
  • @egreg: I agree. It's better not to shift the heading. May 12, 2011 at 20:08
  • You'll be pleased to hear, I settled on not shifting the heading after all.
    – ptrcao
    Jun 18, 2011 at 12:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .