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 working on a LaTeX table and R, but I am facing some problems concerning column width and alignment.

cat("\\centering","\n")

cat("\\rowcolors{2}{burlywood1}{white}","\n")
cat("\\begin{tabular}{>{\\rule{0pt}{.5cm}}>{\\arraybackslash}m{2.25 cm}>{\\arraybackslash}m{2.25cm}c>{\\arraybackslash}m{7.5cm}c>{\\arraybackslash}m{2cm}c}","\n")
#cat("\\hline","\n")
cat("\\rowcolor{goldenpoppy} \\textbf{Col1} &\\textbf{Col2} &\\textbf{Col3} &\\textbf{Col4} &\\textbf{Col5}\\\\","\n")        
cat("\\hline","\n")  

enter image description here

In the above example Col1 is bottom aligned while others Col2, Col3, Col4 and Col5 are top aligned. Also how can I keep column width fixed?

share|improve this question
1  
m{<len>}-columns have a fixed width of <len> and provides vertically centred alignment. That answers your question yet you're already using an m-column. So, perhaps you should rephrase your question...? –  Werner Jun 1 '12 at 4:22
    
Ok it seems to be fixed length but why fist column is Col1 it bottomaligned. –  manish Jun 1 '12 at 6:51

1 Answer 1

up vote 3 down vote accepted

m column means centre vertically, if you want to align on the baseline of the top line in each cell use p not m.

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.