简体   繁体   English

HTML,从表格的左上角单元格中删除边框

[英]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? 知道怎么做到这一点?

Try like this: Demo 试试这样: 演示

table tr.border-less>td {
    border-top: 0px solid #FFFFFF;
    border-left: 0px solid #FFFFFF;
}

Remove border from table and tr and apply border only for td . tabletr删除边框并仅为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.

相关问题 表格单元格内容:在HTML中将文本的左上角和中间对齐 - Table cell content: align text top-left and image in the middle in HTML 如何在表格的左上角单元格中删除边框并更改背景颜色? - How to remove border and change background-color in top left cell of table? 如何在div的左上角边框内放置文本 - How to place a text inside the top-left corner border of div 使用iFrame时WebBrowser中的左上白边框 - Top-Left White Border in WebBrowser When Using iFrame 如何计算HTML元素的左上角和窗口的左上角之间的距离? - How to calculate the distance between the top-left corner of an HTML element and the window top-left corner? Html选择元素 - 如何将选项元素左上角与左上角的选择元素重叠 - Html Select Element - how to overlap option element top-left with select element top-left 如何在表格的左上方和右上方放置按钮? - How to put a button top-left and top-right of a table? HTML / D3.js -如何从鼠标光标而不是左上角进行缩放 - HTML / D3.js - how to zoom from the mouse cursor rather than top-left corner Firefox忽略表格单元的边框左上角半径 - Firefox ignores border top left radius on table-cell 从父表内部的表的最后一个单元格中删除左边界 - Remove border-left from last cell in a table which is inside a parent table
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM