Graphics, Figures & Tablesugly table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
pwkip
Posts: 2
Joined: Thu May 14, 2009 3:56 am

ugly table

Post by pwkip »

I use the folowing code

Code: Select all

\begin{table}[t]
\centering
\begin{tabular}{c|c|c|c}
\hline\hline
                                   &   & \multicolumn{2}{c}{Voorspelde klasse}   \\
\hline
                                   &              & $A$ & $\bar{A}$              \\
\hline
\multirow{2}{*}{Werkelijke klasse} & $A$          & TP  & FN                     \\
\cline{2-4}
                                   & $\bar{A}$    & FP & TN                      \\
\hline
\end{tabular}
\caption{De algemene contingecy table}
\label{tab:contingecytable}
\end{table}
Image

I would like the last two columns to have distributed widths, how do i do this?

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
emime
Posts: 9
Joined: Wed Apr 15, 2009 10:43 pm

ugly table

Post by emime »

Hello,
this is probably due to a limit (or a bug) of multirow package. The multicolumn head
is too long and sub-columns fail in being distrubted evenly.
You can use hspace. The following is not a definitive solution, but works.

Code: Select all

begin{table}[t]
\centering
\begin{tabular}{c|c|c|c}
\hline\hline
 & & \multicolumn{2}{c}{Voorspelde klasse}  \\
\hline
                                   &              &\hspace{10pt} $A$\hspace{10pt} & $\bar{A}$              \\
\hline
\multirow{2}{*}{Werkelijke klasse} & $A$          & \hspace{10pt}TP\hspace{10pt} & FN                     \\
\cline{2-4}
                                   & $\bar{A}$    & \hspace{10pt}FP\hspace{10pt} & TN                      \\
\hline
\end{tabular}
\end{table}
pwkip
Posts: 2
Joined: Thu May 14, 2009 3:56 am

Re: ugly table

Post by pwkip »

Thanks a lot! It did the trick :D
Post Reply