css3 - CSS how to use pseudo-class :not with :nth-child -
It is possible to use
I tried to do this without any luck: Although this works: I am trying to align all the table columns in the middle except 2 and 4 columns. Columns are dynamically generated to add a custom class to these columns. To exclude the second and fourth, you need one of these: : not () with
nth-child ?
td: not (: nth-child (4n)) {text-align: center; }
td: not (: first-child) {text-align: center; }
: no (: nth-child (4n)) Which is not
: nth-child (4n) , which is not the fourth, 8th and so on. This will not leave the second child because 2 in 4 are not valuable.
td: no (: nth-child (2n)) < / Code> If you have less than 6 columns, or
td: not (: nth-child (2)): no (: nth-child ( 4)) If you have at least 6 columns and do not want to leave only 2 and 4th and only every column.
Comments
Post a Comment