Yeah, I don't see how to do that all in CSS, but pretty trivial in JS coding.
But that also doesn't match what you showed in the first post, where you have ID's "C1p" and "C1c".
So are A1, B1, C1, etc., class names??
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.