It's not "pure CSS" if it's using data-attributes. It's CSS and HTML. With an access to both of these it's a trivial job. It would be sensational if someone would find a solution for that without using the latter (or JS, or server side processing) - for example: for the user generated content.
My joke-solution (working only for fixed amount of rows, with fixed dimensions): multiplying the headers for each row with text-shadow.
My joke-solution (working only for fixed amount of rows, with fixed dimensions): multiplying the headers for each row with text-shadow.