How to style each table cell in a column via CSS?

前端 未结 6 975
慢半拍i
慢半拍i 2020-12-13 08:22

I have an ordinary HTML table:

6条回答
  •  天涯浪人
    2020-12-13 08:50

    Additionally to Sean Patrick Floyd's solution you can combine :first-child with the adjacent sibling selector + (also not supported by IE6):

    td:first-child { /* first column */ }
    
    td:first-child + td { /* second column */ }
    
    td:first-child + td + td { /* third column */ }
    
    /* etc. */
    

提交回复
热议问题
FAT ...