Border Radius for each row in a table

后端 未结 3 809
感情败类
感情败类 2021-01-07 06:59

I am having the table like this and I want to apply style to each row with rounded corner.


    <         
3条回答
  •  孤街浪徒
    2021-01-07 07:43

    tr {
        border-radius:5px;
        border:2px solid red;
    }
    

    Change one letter, d, to r (td to tr).

    Edit: Sorry, you can't apply border to tr. Try this 'hack' instead, borrowed from here:

    table { border-collapse: separate; }
    td { border: solid 1px #000; }
    tr:first-child td:first-child { border-top-left-radius: 10px; }
    tr:first-child td:last-child { border-top-left-radius: 10px; }
    tr:last-child td:first-child { border-top-left-radius: 10px; }
    tr:last-child td:last-child { border-top-left-radius: 10px; }
    

提交回复
热议问题
Month