I am working on a LaTeX table and R, but I am facing some problems concerning column width and alignment.


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("\\rowcolor{goldenpoppy} \\textbf{Col1} &\\textbf{Col2} &\\textbf{Col3} &\\textbf{Col4} &\\textbf{Col5}\\\\","\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?

  • 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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.