去掉html表格边框的方法:首先创建一个HTML示例文件;然后在body中通过table标签创建表格内容;最后通过“border-left: none;border-right: none;”等css属性去掉指定的表格边框即可。
本文操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。
HTML中Table去掉左右两边的边框.table {
text-align: center;
}
.table table {
font-size: 14px;
border-collapse: collapse;
width: 70%;
table-layout: fixed;
text-align: center;
line-height: 25px;
margin:0 auto;
}
.table table tr {
border: dashed 1px #a59e9e;
border-left: none;
border-right: none;
}
效果如图所示:
附上原html代码:
Table去掉左右两边的边框.table {
text-align: center;
}
.table table {
font-size: 14px;
border-collapse: collapse;
width: 70%;
table-layout: fixed;
text-align: center;
line-height: 25px;
margin:0 auto;
}
.table table tr {
border: dashed 1px #a59e9e;
border-left: none;
border-right: none;
}
人员信息
姓名 | 性别 | 年龄 | 出生日期 | 地址 |
小明 | 男 | 20 | 1998-10-12 | 北京市 |
小花 | 女 | 19 | 1999-02-02 | 上海市 |
小强 | 男 | 22 | 1996-05-04 | 上海市 |
【推荐学习:css视频教程】