脚本宝典收集整理的这篇文章主要介绍了html怎么将表格边框隐藏,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
html将表格边框隐藏的方法:1、使用style属性给table、th、td元素添加“border: none;”样式;2、使用style属性给table元素添加“border-color: transparent;”样式。
本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。
我们有下面一个表格:
<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>
怎么将这个表格的边框隐藏起来?下面介绍一下方法:
1、给table、th、td元素添加border: none;
样式
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <table border="1" style="border: none;"> <tr> <th style="border: none;">姓名</th> <th style="border: none;">年龄</th> </tr> <tr> <td style="border: none;">Peter</td> <td style="border: none;">20</td> </tr> <tr> <td style="border: none;">Lois</td> <td style="border: none;">20</td> </tr> </table> </body> </html>
2、给table元素添加border-color: transparent;
样式
<table border="1" style="border-color: transparent;"> <tr> <th>姓名</th> <th>年龄</th> </tr> <tr> <td>Peter</td> <td>20</td> </tr> <tr> <td>Lois</td> <td>20</td> </tr> </table>
推荐教程:《html视频教程》
以上就是html怎么将表格边框隐藏的详细内容,更多请关注脚本宝典其它相关文章!
以上是脚本宝典为你收集整理的html怎么将表格边框隐藏全部内容,希望文章能够帮你解决html怎么将表格边框隐藏所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。