Latex table (cross-row, cross-column, background gray) new

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.