Graphics, Figures & TablesProblem with \multicolumn

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
niek
Posts: 6
Joined: Sat May 15, 2010 3:32 pm

Problem with \multicolumn

Post by niek »

Dear all,

I am having trouble with a table and I hope someone can help me out. Please consider the following code:

Code: Select all

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l | r r r r }
Sample criteria       & %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                                              \\
\hline
                      & \underline{$k=1$}
                            & \underline{$k=2$}
                                  & \underline{$k=5$}
                                        & \underline{$k=10$}  \\
\multirow{2}{*}{$A$}  & -   & -   & -   & X                   \\
                      & -   & -   & -   & X                   \\
\hline
\multirow{2}{*}{$B$}  & -   & -   & -   & X                   \\
                      & -   & -   & -   & X                   \\
\hline
\multirow{2}{*}{$C$}  & -   & -   & -   & X                   \\
                      & -   & -   & -   & X                   \\
\hline
\end{tabular*}
What I want is a title where the %-signs are positioned, that spans four columns. I have tried the following:

Code: Select all

\multicolumn{4}{l}{Total observations}	
... but this isn't working properly. The title appears, but the far right column under the title, marked with X's, is now about twice as wide as the others, while its contents are of equal width, compared to the others.

How can I include the title the way I want it, without somehow changing the last column's width?

Hope to hear from you!


Best,

Niek

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

niek
Posts: 6
Joined: Sat May 15, 2010 3:32 pm

Problem with \multicolumn

Post by niek »

In addition: this is the actual title I want to span over the four columns: "Total number of banks and observations".

Code: Select all

\multicolumn{4}{l}{Total number of banks and observations}
It might have to do with the length of the title, despite that it should be able to fit.

Thanks!
Post Reply