加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

如何仅删除html表中指定行的底部边框

发布时间:2020-12-14 22:39:39 所属栏目:资源 来源:网络整理
导读:我有简单的html表,我想在特定行上删除tr的底部边框. 桌子 我试过的是将类添加到tr我想要的没有底部边界类=“no-bottom-border”并用css删除它 tr .no-bottom-border {border-bottom: none} 这似乎不起作用.这是桌子上的JSFIDDLE 最佳答案 定位td的边框,因为t

我有简单的html表,我想在特定行上删除tr的底部边框.

桌子

我试过的是将类添加到tr我想要的没有底部边界类=“no-bottom-border”并用css删除它

tr .no-bottom-border {border-bottom: none}

这似乎不起作用.这是桌子上的JSFIDDLE

最佳答案
定位td的边框,因为tr没有边框属性.

演示

table,caption,tbody,tfoot,thead,tr,th,td {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  vertical-align: baseline;
  background: transparent;
}

table {
  border: 1px solid #ccc;
  color: #37393b;
  margin: 10px 0 0 0;
  text-shadow: #fff 1px -1px 1px;
  text-align: left;
  width: 100%;
}

table tbody tr td {
  background: #FFF;
  border-bottom: 1px dotted #d00;
}

tr.no-bottom-border td {
  border-bottom: none
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!