[英]HTML, remove border from top-left cell of a table
I have a html table, my top-left cell is empty and I want to remove its border. 我有一个html表,我的左上角单元格是空的,我想删除它的边框。
I tried with some css: 我尝试了一些css:
.border-less {
border-top: 1px solid #FFFFFF;
border-left: 1px solid #FFFFFF;
}
That I applied to my top left cell: 我申请了左上角的单元格:
<td class="border-less"></td>
but it doesn't work. 但它不起作用。
Any idea how to achieve this? 知道怎么做到这一点?
Remove border from table
and tr
and apply border only for td
. 从
table
和tr
删除边框并仅为td
应用边框。
table { border-collapse: collapse; } td { border: 1px solid grey; } td.border-less { border: none; }
<table> <tr> <td class="border-less"></td> <td>22</td> <td>33</td> </tr> <tr> <td>11</td> <td>22</td> <td>33</td> </tr> <tr> <td>11</td> <td>22</td> <td>33</td> </tr> </table>
check out this 看看这个
CSS CSS
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
.border-less {
border-top: 1px solid #FFFFFF;
border-left: 1px solid #FFFFFF;
}
http://jsfiddle.net/vasanthanvas/jfvhxy59/ http://jsfiddle.net/vasanthanvas/jfvhxy59/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.