1

I'm having a long-table with long text at each cell. The text is vertically align at the center of the cell, however, I want to align it to the cell top. How can I do that?

below is the code and the output of it

 \begin{landscape}
\begin{longtable}[t]{c c m{6cm} m{7cm} m{2cm}}
    \caption{Description of progress toward answering research questions}
    \label{tab:res_ques}\\
    \toprule
        \textbf{Question no.} & \textbf{Status} & \textbf{Output} & \textbf{Details} & \textbf{Question focus}\\
    \toprule
Q.1 & Completed & It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way—in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only. & There were a king with a large jaw and a queen with a plain face, on the throne of England; there were a king with a large jaw and a queen with a fair face, on the throne of France. In both countries it was clearer than crystal to the lords of the State preserves of loaves and fishes, that things in general were settled for ever. & The focus of this question is mainly toward application.\\

\bottomrule
    
\end{longtable}

\end{landscape}

enter image description here

5
  • 3
    Just change the three m column types to p. – Mico Oct 27 '20 at 17:57
  • Off-topic: The second instance of \toprule should probably be changed to \midrule. – Mico Oct 27 '20 at 18:00
  • Thanks, @Mico, that worked fine! – E. Aly Oct 27 '20 at 18:05
  • The overall look of the table (reduced amount of unused white space) would benefit from a different column width ration such as \begin{longtable}[t]{c c p{8cm} p{5cm} p{2cm}}. – leandriis Oct 27 '20 at 19:15
  • 1
    note that by default only p (top align) is defined. You must have loaded array package to define m columns. – David Carlisle Oct 27 '20 at 19:40
2

(re-posting my earlier comment, so that the query can be checked off as having received an "official" answer)

  • The m column type aligns the cell contents along the "middle".

  • For alignment along the top edges of the cells, use the p column type.

  • For bottom alignment, use the b column type.

As @DavidCarlisle has noted in a comment, it's worth pointing out that the p column type is defined in the LaTeX kernel, whereas the m and b column types are defined in the array package.

2
  • 2
    Worth saying that p is defined by default, m and b come from the array package. – David Carlisle Oct 27 '20 at 19:40
  • @DavidCarlisle - Thanks for this suggestion; I've updated the answer. – Mico Oct 27 '20 at 20:10

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.