Latex 表格(跨行、跨列、背景加灰)new
一、 效果如图
二、代码如下
1. 首部增加宏包:
\usepackage{multirow}
2. 正文部分增加:
\begin{table}
\centering
\caption{Suspiciousness of statements for \texttt{foo()} computed by different approaches}
\label{Tbl:Suspiciousness}
\begin{tabular}{|c||c|c|c|c||c|c|c|c|}
\hline
\multirow{}{*}{statement} & \multicolumn{}{c||}{coverage based} & \multicolumn{}{c|}{hybrid slice spectrum based} \\
\cline{-} & Tarantula & Naish2 & R\&R & HSS & Tarantula & Naish2 & R\&R & HSS \\ \hline \hline
$s_{}$ & 0.5 & 2.17 & 0.38 & 0.89 & 0.5 & 2.2 & 0.38 & 0.91 \\ \rowcolor{gray!} % set next line gray background color
$s_{}$ & 0.5 & 2.17 & 0.38 & 0.89 & 0.5 & 2.2 & 0.38 & 0.91 \\
$s_{}$ & 0.5 & 2.17 & 0.38 & 0.89 & 0.25 & 0.2 & 0.13 & 0.05 \\
$s_{}$ & 0.5 & 2.17 & 0.38 & 0.89 & 0.5 & 2.2 & 0.38 & 0.91 \\
$s_{}$ & 0.53 & 1.5 & 0.25 & 0.41 & 0.57 & 1.6 & 0.25 & 0.43 \\
$s_{}$ & 0.53 & 1.5 & 0.25 & 0.41 & 0.4 & 0.6 & 0.13 & 0.09 \\
$s_{}$ & 0.53 & 1.5 & 0.25 & 0.41 & 0.57 & 1.6 & 0.25 & 0.43 \\
$s_{}$ & 0.5 & 2.17 & 0.38 & 0.89 & 0.5 & 2.2 & 0.38 & 0.91 \\
$s_{}$ & 0.53 & 1.5 & 0.25 & 0.41 & 0.57 & 1.6 & 0.25 & 0.43 \\
$s_{}$ & 0.45 & 0.67 & 0.13 & 0.09 & 0.4 & 0.6 & 0.13 & 0.09 \\
$s_{}$ & 0.5 & 2.17 & 0.38 & 0.89 & 0.5 & 2.2 & 0.38 & 0.91 \\ \hline \hline
fault rank & - & - & - & - & - & - & - & - \\ \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 \end{tabular}
\end{table}
三、代码解释
- 跨行、跨列代码为第7、8 行:
\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 - 加灰色代码为第9行:(作用是将第10行背景设为灰色)
\rowcolor{gray!40} % set next line gray background color
Latex 表格(跨行、跨列、背景加灰)new的更多相关文章
- latex制作表格-跨行跨列
1.列的合并,使用 \multicolumn{跨几列}{格式}{填充内容} \documentclass[UTF8]{ctexart} \begin{document} 三囚犯问题进行300次实验后\ ...
- javascript 将 table 导出 Excel ,可跨行跨列
<script language="JavaScript" type="text/javascript"> //jQuery HTML导出Excel ...
- Excel中复杂跨行跨列数据
XSSFWorkbook wb = new XSSFWorkbook(); // 工作表 XSSFSheet sheet = wb.createSheet("车辆使用情况统计"); ...
- HTML表格跨行、跨列操作(rowspan、colspan)
转自:https://blog.csdn.net/u012724595/article/details/79401401 一般使用<td>元素的colspan属性来实现单元格跨列操作,使用 ...
- colspan是跨列,rowspan是跨行
colspan是跨列,rowspan是跨行,可以看作是网页设计表格中的列和行的一个属性.跨列相当于把两列或者多列合并成一个单元格:跨行同理是把两行或者多行合并成一行:colspan和rowspan分别 ...
- table中tr间距的设定table合并单元格 colspan(跨列)和rowspan(跨行)
table中的tr的默认display:table-row,虽然可以修改为display:block但是就失去了tr特有的显示效果,如(td自动对齐): 并且在tr中对起设定padding是有用的,可 ...
- table合并单元格 colspan(跨列)和rowspan(跨行)
colspan和rowspan这两个属性用于创建特殊的表格. colspan是“column span(跨列)”的缩写.colspan属性用在td标签中,用来指定单元格横向跨越的列数: 在浏览器中将显 ...
- Java 操作Word表格——创建嵌套表格、添加/复制表格行或列、设置表格是否禁止跨页断行
本文将对如何在Java程序中操作Word表格作进一步介绍.操作要点包括 如何在Word中创建嵌套表格. 对已有表格添加行或者列 复制已有表格中的指定行或者列 对跨页的表格可设置是否禁止跨页断行 创建表 ...
- easyui DataGrid表体单元格跨列rowspan
最近做项目用到了jquery easyui,其中一组DataGrid做的报表是给客户大领导看的,客户要求报表样式跟他们原有系统的一模一样(如下图1). DataGrid样式好调,只是城市名称单元格跨行 ...
随机推荐
- Codeforces 757C. Felicity is Coming!
C. Felicity is Coming! time limit per test:2 seconds memory limit per test:256 megabytes input:stand ...
- Eclipse生成部署描述符(web.xml)
右键点击你的web项目名--->Java EE Tools-->Generate Deployment Descriptor Stub 要想自动生成,只需在创建web项目时,把最后一页的 ...
- c sharp dll
1. generate dll building .cs file, for example: myDll.cs using System; using System.Collections.Gene ...
- Sketch 和 PS中的设计图如何实现“自动切图”?
切图是很多UI设计师的一项日常工作.平时做完设计图,要将设计稿切成便于制作成页面的图片,并标注好尺寸和间距,交付给前端来完成html+css布局的静态页面,有利于交互,形成良好的视觉感. 但有的认为前 ...
- 全面了解HTTP请求方法说明
超文本传输协议(HTTP, HyperText Transfer Protocol)是一种无状态的协议,它位于OSI七层模型的传输层.HTTP客户端会根据需要构建合适的HTTP请求方法,而HTTP服务 ...
- 再读c++primer plus 006
使用类: 1.重载限制:(1)重载后的运算符必须至少有一个操作数是用户定义的类型,这将防止用户为标准类型重载运算符 (2)使用运算符时不能违反运算符原来的语法规则,不能修改运算符的优先级 (3)不能创 ...
- substr()和substring()函数
区别:主要是两者的参数不同 功能:相似. substr :返回一个从指定位置开始的指定长度的子字符串 substring :返回位于 String 对象中指定位置的子字符串. 用法: stringva ...
- vue属性值调方法
<td>{{showPrice(product.sellprice)}}</td>
- WEB应用支持RESTFUL风格方法
REST概念 Restful就是一个资源定位及资源操作的风格.不是标准也不是协议,只是一种风格.基于这个风格设计的软件可以更简洁,更有层次,更易于实现缓存等机制. REST风格 资源:互联网所有的事物 ...
- jitter
release jitter of tasks there is a distinction between the real activation request and the actual ac ...