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 this table

\documentclass[a4paper]{scrartcl}
\usepackage{longtable}
\begin{document}

\begin{longtable}{c|p{6cm}p{4cm}p{4cm}}
\hline
Blub & Bla & Blip & Blop \\
Blub & Bla & Blip & Blop \\
\hline
\end{longtable}
\end{document}

Now, for whatever reason, I would like to center ONE cell of the second column. How would I achieve that?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

Since you're using a paragraph column type (with fixed length), you can issue \centering inside the cell to centre it:

\documentclass[a4paper]{scrartcl}
\usepackage{longtable}
\begin{document}

\begin{longtable}{c|p{6cm}p{4cm}p{4cm}}
\hline
Blub & Bla & Blip & Blop \\
Blub & \centering Bla & Blip & Blop \\
\hline
\end{longtable}
\end{document}

Other column types (like l and r) requires a different approach.

share|improve this answer
    
Wow... I bet I tried that before... oh well. Thanks! –  cherrung Jul 13 '12 at 21:22
2  
With the caveat that if the last column is involved, either one says \centering\arraybackslash or ends the cell by \tabularnewline. –  egreg Jul 13 '12 at 21:35
add comment

Another approach -- which works regardless of whether the column is specified via l, r, or p monikers -- is to use the \multicolumn command. This command takes three arguments: set 1 as the first argument (the number of columns), c as the second argument (to center it, in this case), and "Bla" (or whatever it may be...) as the third argument:

\multicolumn{1}{c}{Bla}
share|improve this answer
add comment

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.