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 have a simple table and want to center only the titles of each column, how can I individually center them ?

I tried \centering{} but this only works for the first column.

share|improve this question
1  
how about using a multicolumn? –  cmhughes Apr 11 '13 at 23:45
1  
\multicolumn{1}{c}{title} –  Gonzalo Medina Apr 11 '13 at 23:45
    
\centering works the same way in a table as out of it, it works in vertical mode (do p columns) but not in horizontal (LR) modeso \mbox or table l columns. –  David Carlisle Apr 11 '13 at 23:55
    
@cmhughes I already have the table set out, how do I incorporate \multicolumn with the table ? Do I have to change everything ? :\ –  Razor Apr 12 '13 at 0:31
    
just the bit you want to change- see Gonzalo's comment :) –  cmhughes Apr 12 '13 at 0:31

1 Answer 1

up vote 1 down vote accepted

Use \multicolumn, as advised in the comments. Here is a baby example:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{tabular}{ll}
\multicolumn{1}{c}{title~1} & \multicolumn{1}{c}{title~2}\\
foofoofoo & barbarbar \\
foofoofoo & barbarbar \\
foofoofoo & barbarbar \\
\end{tabular}
\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.