Re: Rendere tabella complessa.

#78914
Up
0
Down
::

Bruber” post=77962La mia tabella di partenza è scritta dal seguente codice
`
\begin{table}[!ht]
\centering
\begin{tabular}{|c|c|c|c|} \hline
{\em } & {\em Camera} & {\em CG} & {\em Scanner}\\ \hline
{\em Camera} & \textbf{86\%} & 1.9\% & 12.6\%\\ \hline
{\em CG} & 7.8\% & \textbf{83.8\%} & 8.5\%\\ \hline
{\em Scanner} & 11\% & 17.1\% & \textbf{72.3\%} \\ \hline
\end{tabular}
\caption{Matrice di confusione con $TH=0.85$}
\label{conf_matrix}
\end{table}
`

Al di là del contenuto vorrei trasformarla in quella nella foto, aggiungendo le riga superiore e la colonna a sinistra.:???:

http://imageshack.us/a/img713/3703/contingenza.jpg

Grazie!

`\begin{tabular}{|c|c|c|c|c|}
\cline{3-5}
\multicolumn{1}{c}{} & \multicolumn{1}{c|}{} & \multicolumn{3}{c|}{Valore predetto} \\
\cline{3-5}
\multicolumn{1}{c}{} & \multicolumn{1}{c|}{} & \emph{Camera} & \emph{CG} & \emph{Scanner}\\
\hline
& \emph{Camera} & \textbf{86\%} & 1.9\% & 12.6\%\\
\cline{2-5}
Valore vero & \emph{CG} & 7.8\% & \textbf{83.8\%} & 8.5\%\\
\cline{2-5}
& \emph{Scanner} & 11\% & 17.1\% & \textbf{72.3\%} \\
\hline
\end{tabular}`

Ora un altro modo, che richiede il pacchetto booktabs

`\begin{tabular}{ccccc}
\toprule
& & \multicolumn{3}{c}{Valore predetto} \\
\cmidrule{3-5}
& & \emph{Camera} & \emph{CG} & \emph{Scanner}\\
\midrule
Valore vero & \emph{Camera} & \textbf{86\%} & 1.9\% & 12.6\%\\
& \emph{CG} & 7.8\% & \textbf{83.8\%} & 8.5\%\\
& \emph{Scanner} & 11\% & 17.1\% & \textbf{72.3\%} \\
\bottomrule
\end{tabular}`
Ciao
Enrico

Go to top