Using CSS how to change only the 2nd column of a table

后端 未结 5 1295
悲&欢浪女
悲&欢浪女 2021-01-30 00:20

Using css only, how can I override the css of only the 2nd column of a table.

I can get to all of the columns using:

.countTable table table td
<         


        
5条回答
  •  暖寄归人
    2021-01-30 00:53

    Try this:

    .countTable table tr td:first-child + td
    

    You could also reiterate in order to style the others columns:

    .countTable table tr td:first-child + td + td {...} /* third column */
    .countTable table tr td:first-child + td + td + td {...} /* fourth column */
    .countTable table tr td:first-child + td + td + td +td {...} /* fifth column */
    

提交回复
热议问题