First, the effect
Second, the code is as follows
1 \begin{table}2 \centering3\caption{suspiciousness of statements for\texttt{foo ()} computed by different approaches}4 \label{tbl:suspiciousness}5\begin{tabular}{|c| | c|c|c|c| | c|c|c|c|}6 \hline7\multirow{2}{*}{statement} & \multicolumn{4}{c| |} {coverage based} & \multicolumn{4}{c|}{hybrid Slice spectrum based} \8\cline{2-9} & Tarantula & Naish2 & R\&r & HSS & Tarantula & Naish2 & R\&r &HSS \ \hline \hline9$s _{1}$ &0.5&2.17&0.38&0.89&0.5&2.2&0.38&0.91\ \rowcolor{gray! +} %Set next line gray background colorTen$s _{2}$ &0.5&2.17&0.38&0.89&0.5&2.2&0.38&0.91 \ One$s _{3}$ &0.5&2.17&0.38&0.89&0.25&0.2&0.13&0.05 \ A$s _{4}$ &0.5&2.17&0.38&0.89&0.5&2.2&0.38&0.91 \ -$s _{5}$ &0.53&1.5&0.25&0.41&0.57&1.6&0.25&0.43 \ -$s _{6}$ &0.53&1.5&0.25&0.41&0.4&0.6&0.13&0.09 \ the$s _{7}$ &0.53&1.5&0.25&0.41&0.57&1.6&0.25&0.43 \ -$s _{8}$ &0.5&2.17&0.38&0.89&0.5&2.2&0.38&0.91 \ -$s _{9}$ &0.53&1.5&0.25&0.41&0.57&1.6&0.25&0.43 \ -$s _{Ten}$ &0.45&0.67&0.13&0.09&0.4&0.6&0.13&0.09 \ +$s _{ One}$ &0.5&2.17&0.38&0.89&0.5&2.2&0.38&0.91\ \hline \hline -Fault Rank &5-Ten&1-6&1-6&1-6&4-8&1-5&1-5&1-5\ \hline +Loc. Cost (\%) &45.5-90.9&9.1-54.5&9.1-54.5&9.1-54.5&36.4-72.7&9.1-45.5&9.1-45.5&9.1-45.5\ \hline A at \end{tabular} -\end{table}
Third, the code explanation
- Cross-row, cross-column code is 7th, 8 lines:
\multirow{2}{*}{statement} & \multicolumn{4}{c| |} {coverage based} & \multicolumn{4}{c|} {Hybrid slice spectrum based} \ 8 \cline{2-9} & Tarantula & Naish2 & R\&r & HSS & Tarantul A & Naish2 & r\&r & HSS \ \hline
- Add gray code to line 9th: (effect is to set the 10th line background to gray)
\ROWCOLOR{GRAY!40} % Set next line gray background color
Latex table (cross-row, cross-column, background gray) new