我想知道如何在 HTML 中隐藏一行。使用 CSS 方法style="empty-cells : hide;"
似乎可行,但如果<h4>
标签包含在空表中,则不会隐藏该行。
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
</head>
<body>
<form name="form_simple" action=" " method="get">
<table border="1px" style="empty-cells : hide;">
<tr><td><h4>Empty cells should not have any borders around them</h4></td></tr>
<tr><td></td></tr>
<tr><td><h4>Empty cells should not have any borders around them.</h4></td></tr>
<tr><td><h4>Empty cells should not have any borders around them.</h4></td></tr>
</table>
</form>
</body>
</html>
style="empty-cells : hide;"
适用于<tr><td></td></tr>
,但不适用于<tr><td><h4></h4></td></tr>