How to hide the border for specified rows of a table?

前端 未结 4 574
清酒与你
清酒与你 2021-02-06 21:32

I want to hide the border for a specific rows of a table.How to do it?
Any Idea?
Sample code is Highly Appreciated.

4条回答
  •  时光取名叫无心
    2021-02-06 22:27

    Use the CSS property border on the s following the s you do not want to have the border.

    In my example I made a class noBorder that I gave to one . Then I use a simple selector tr.noBorder td to make the border go away for all the s that are inside of s with the noBorder class by assigning border: 0.

    Note that you do not need to provide the unit (i.e. px) if you set something to 0 as it does not matter anyway. Zero is just zero.

    table, tr, td {
      border: 3px solid red;
    }
    tr.noBorder td {
      border: 0;
    }
    A1 B1 C1
    A2 B2 C2
    A3 A3 A3

    Here's the output as an image:

    Output from HTML

提交回复
热议问题