1

I have the following example LaTeX table code:

\begin{tabular}{lllll}
\hline
\multicolumn{4}{c}{all clusters} \\
\cline{2-5}
clust. size & no. clust. & (\%) & no. spec. & (\%) \\
\hline
1      & 12403    & 68.9\% & 127834 & 22.7\%  \\
2      & 2343     & 45.5\% & 13434  & 15.6\%  \\
\hline
\end{tabular}

I want 'all clusters' in the center of the columns no. clust., (\%), no. spec. and (\%). However, now it also takes clust. size in consideration with centering, so the text gets put on top of no. clust., instead of in between no. clust and `(\%).

How can I center this column title on only what is in the second multicolumn?

4

I think, you miss & in front of \multicolumn{4}{c}{all clusters}.

2
\documentclass{standalone}

\begin{document}
\begin{tabular}{lllll}
\hline
&\multicolumn{4}{c}{all clusters} \\
\cline{2-5}
clust. size & no. clust. & (\%) & no. spec. & (\%) \\
\hline
1      & 12403    & 68.9\% & 127834 & 22.7\%  \\
2      & 2343     & 45.5\% & 13434  & 15.6\%  \\
\hline
\end{tabular}
\end{document}

enter image description here

  • ops.. @somkiat_t already answered, sorry – Red Sep 9 '13 at 8:54

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.