How to remove particular cell from HTML table?

◇◆丶佛笑我妖孽 提交于 2020-01-23 18:58:25

问题


Suppose I have HTML table and I want to remove one cell from HTML table something like this:

I have changed cell border color to white since the border color of whole table is black so it is showing grey color. Problem is I can't remove table border so I have used border-collapse:collapse

So how can I change it in such a way that border color remains black and cell is not appeared in table?


回答1:


You can hide the cell by setting the visibility to hidden.

http://jsfiddle.net/S5tnv/

CSS

td {
    visibility: hidden;
}



回答2:


You'd use something like this:

table tr:last-child td:first-child { display: none; }



回答3:


This worked for me, just try putting the style attribute in the cell that you wish to have with no border with a border size property of zero pixels:

<td style="border:0px"></td>


来源:https://stackoverflow.com/questions/15804029/how-to-remove-particular-cell-from-html-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!