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?

2 Answers 2

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .