<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table{
50%;
border:1px solid black;
/* 边框合并 */
border-collapse: collapse;
text-align: center;
}
td,th{
border:1px solid black;
}
/* 奇数行改变颜色 odd 为奇数 even为偶数 */
tr:nth-child(odd){
background-color: lime;
}
</style>
</head>
<body>
<table>
<tr><th>日期</th><th>收入</th><th>支出</th><th>合计</th></tr>
<tr><td>2019.1.1</td><td>500</td><td>200</td><td>300</td></tr>
<tr><td>2019.1.2</td><td>500</td><td>200</td><td>300</td></tr>
<tr><td>2019.1.3</td><td>500</td><td>200</td><td>300</td></tr>
<tr><td colspan="3">合计</td><td>900</td></tr>
</table>
</body>
</html>