I have been successfully using xcolor and its \cellcolor command for a while, and produced beautiful results with it. However, I would like to create some more advanced background effects: color the cell with two colors:
The example above is produced using https://tex.stackexchange.com/a/263403/17312, but this approach falls apart for a number of reasons:
- Tikz's matrix command is not nearly as powerful as ordinary tabulars with the
arraypackage and others. I have some numeric data that I am happily aligning on the decimal point usingdcolumn- I have no idea how I would do this is in a tikz matrix. - I would like to emulate booktabs behaviour, but I just can't get it working. https://tex.stackexchange.com/a/21178/17312 suggests a workaround, but it doesn't work.
The coloring falls apart if the width of the columns is not predefined:

and it all falls apart.
- I have had a look through other questions; https://tex.stackexchange.com/a/346212/17312 and https://tex.stackexchange.com/a/81998/17312 manage to create one-colored bars dynamically; https://tex.stackexchange.com/a/148797/17312 combines
tabularxandtikzin a promising approach, but I did not manage to adapt this to my purpose; Aligning tikz nodes to tabular cells? draws lines and manages to stick to a tabular environment - maybe a good starting point?
So ideally I would like to stick to a tabular environment, and be able to specify the cells' background content freely (for the point of this question I would be happy with a solution that gives me the diagonally separated effect as in the top left corner of the two examples), with a command such as \twocolor{blue}{purple}.



