x
1
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<style>
6
table,
7
th,
8
td {
9
border: 1px solid black;
10
}
11
12
tr.collapse {
13
visibility: collapse;
14
}
15
</style>
16
</head>
17
<body>
18
19
<table>
20
<tr>
21
<th>Firstname</th>
22
<th>Lastname</th>
23
</tr>
24
<tr>
25
<td>Peter</td>
26
<td>Griffin</td>
27
</tr>
28
<tr class="collapse">
29
<td>Lois</td>
30
<td>Griffin</td>
31
</tr>
32
</table>
33
34
<p><b>注意:</b> IE8 及其更早版本需要通过指定 !DOCTYPE 才可以支持 visibility:collapse。</p>
35
36
</body>
37
</html>