Difficulties with application of “nth-of-child” to table cells

前端 未结 2 537
野的像风
野的像风 2021-01-25 05:48

I\'m trying to apply nth-of-child style to table cells, but that don\'t work. According to my code I would like to have each 2nd cell content be right-aligned and has a gray col

相关标签:
2条回答
  • 2021-01-25 06:29

    There is no such thing as the :nth-of-child selector. You appear to have mixed the two :nth-child and :nth-of-type selectors together...

    0 讨论(0)
  • 2021-01-25 06:33
    tr td:nth-child(2) {
        text-align: right;
        color: #ccc;
    }​
    

    DEMO.

    0 讨论(0)
提交回复
热议问题