Style the first column of a table differently

后端 未结 5 729
清歌不尽
清歌不尽 2020-12-25 09:19

If I have a table with two columns, how do I specify a padding or any other css so that it is applied just for the first column of

5条回答
  •  长情又很酷
    2020-12-25 09:46

    You could use the n-th child selector.

    to target the nth element you could then use:

    td:nth-child(n) {  
      /* your stuff here */
    }
    

    (where n starts at 1)

提交回复
热议问题