CodeLab
Show Output
 
xxxxxxxxxx
48
 
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
<meta charset="utf-8">
5
<title>Example of CSS empty-cells property</title>
6
<style>
7
    table {
8
        width: 300px;
9
        border-collapse: separate;
10
    }
11
    table, th, td{
12
        border: 1px solid #000000;
13
    }
14
    table.empty-show {
15
        empty-cells: show;                        
16
    }
17
    table.empty-hide {
18
        empty-cells: hide;           
19
    }        
20
</style>
21
</head>
22
<body>
23
    <h2>Table with Empty-cells</h2>
24
    <table class="empty-show">
25
        <tr>
26
            <th>Name</th>
27
            <td>John Carter</td>
28
        </tr>
29
        <tr>
30
            <th>Email</th>
31
            <td></td>
32
        </tr>
33
    </table>
34
    <br>
35
    <h2>Table with Hidden Empty-cells</h2>
36
    <table class="empty-hide">
37
        <tr>
38
            <th>Name</th>
39
            <td>Peter Parker</td>
40
        </tr>
41
        <tr>
42
            <th>Email</th>
 

在微博、微信、公众号、小程序分享此示例。 如果您觉得有帮助,请给我们一个赞。