On Friday 28 July 2017 12:16 PM, Felix Miata wrote:
Can a :not be used to make td:nth-child(2) not applicable if the element that
the td is a second child of is a td subjected to a colspan? If so, how?

Hi Felix,

I have not tested this extensively for compatibility with all browsers - but I believe something like this could do what you are looking for:

[code]
        td {
                background-color: red;
        }
        td:nth-child(2) {
                background-color: yellow;
        }
        td[colspan]:not([colspan="1"]) {
                background-color: green;
        }
        td[colspan]:not(:nth-child(2)) {
                background-color: black;
        }


Personally, I would not code such complex rules into CSS, I believe a templating engine which applies logic at the server level would be a saner choice.

What is the use case?

Regards
--
Gautam Sathe
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to