I have a longtable setup where to save space, I have to make a column title multi-line and its contents centered while being applied with custom width.

Out of the three I have only successfully applied a custom width because adding \\ or inserting another table inside the column header did not achieve multi-line and c{Xcm} is not permitted for centering a column's contents.

% centering column values
\begin{longtable}{c l l ... }
    % tried to use but does not work
    ... { c{1cm} l l ... }

% long title needs to multi-line, both do not work
\multicolumn{1}{|p{3cm}|}{\textbf{Long Title\\Long Title}} 

        \textbf{Long Title}\\
        \textbf{Long Title}

The situation above is demonstrated in the table on the left but what I want is the one on the right - multi-lined title, centered and compact values of rows.


I have the sample document in WriteLaTeX.


You can load array package and define a new column:


and use it like C{2cm}. Adjust the dimensions 2cm as you wish.




\title{Your Paper}

\caption[Feasible triples for a highly variable Grid]{Feasible triples for
highly variable Grid, MLMMH.} \label{grid_mlmmh} \\

\textbf{Long Time Title} &
\multicolumn{1}{c|}{\textbf{Triple chosen}} &
\multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline

{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\textbf{Long Time Title} &
\multicolumn{1}{c|}{\textbf{Triple chosen}} &
\multicolumn{1}{c|}{\textbf{Other feasible triples}} \\ \hline

\hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline

\hline \hline

Your data & again and again \\


enter image description here

If you want vertical alignment, use


Note m{#1} instead of p{#1}.

This will give

enter image description here

Further, if bottom alignment is need, use b{#1}:

enter image description here

  • Thank you! How do I vertically center "Triple chosen" as seen in the picture though? Oct 13 '13 at 13:31
  • @thekalaban See the update. Is it like that?
    – user11232
    Oct 13 '13 at 13:36

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.