本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。
有这么一个表格:
复制代码1
2
3
4
5
6
7
8
9
10
11
12
13
14
<table border="1">
<tr>
<th>姓名</th>
<th>年龄</th>
</tr>
<tr>
<td>Peter</td>
<td>20</td>
</tr>
<tr>
<td>Lois</td>
<td>20</td>
</tr>
</table>
登录后复制
想要在html中隐藏td标签,怎么做?下面给大家介绍一下方法:
方法1:给td标签设置hidden属性
复制代码1
2
3
4
5
6
7
8
9
10
11
12
13
14
<table border="1">
<tr>
<th>姓名</th>
<th>年龄</th>
</tr>
<tr>
<td>Peter</td>
<td hidden="hidden">20</td>
</tr>
<tr>
<td>Lois</td>
<td>20</td>
</tr>
</table>
登录后复制
方法2:使用style属性给td标签添加“display:none;”样式
复制代码1
2
3
4
5
6
7
8
9
10
11
12
13
14
<table border="1">
<tr>
<th>姓名</th>
<th>年龄</th>
</tr>
<tr>
<td>Peter</td>
<td>20</td>
</tr>
<tr>
<td>Lois</td>
<td style="display: none;">20</td>
</tr>
</table>
登录后复制
推荐教程:《html视频教程》
以上就是html怎么隐藏td标签的详细内容,更多请关注靠谱客其它相关文章!
最后
以上就是单薄发带最近收集整理的关于html怎么隐藏td标签的全部内容,更多相关html怎么隐藏td标签内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复