# LaTeX table non-split cell with diagonal split colour

Kind of a weird circumstance, but I have a table cell where I need the text to be in the cell normally (non-split) and the cell colour to be split diagonally.

I know how to use slashbox to split the cell, but there doesn't seem to be any way to split the colour without also splitting the text. Basically, I need it to look like this:

Any suggestions would be greatly appreciated.

• Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See minimal working example (MWE). – Henri Menke Oct 1 '17 at 1:15
• Possible duplicate of Strike out a table cell. The accepted answer there can be trivially extended to produce the required output. – Henri Menke Oct 1 '17 at 1:17
• @HenriMenke The OP says ". I know how to use slashbox to split the cell, but there doesn't seem to be any way to split the colour without also splitting the text." I don't think the correct duplicate is the one you indicated. – CarLaTeX Oct 1 '17 at 2:47
• @CarLaTeX, that duplicate you linked still has the text split diagonally as well. – Jordan Oct 3 '17 at 20:51
• Sorry, closing vote rectracted – CarLaTeX Oct 3 '17 at 20:54

Since you didn't add an MWE, I can only suppose this is what you need:

\documentclass{article}
\usepackage{makecell}
\usepackage{tikz}
\usetikzlibrary{matrix}
% code (slightly modified) from https://tex.stackexchange.com/a/343392/101651
\tikzset{
diagonal fill/.style 2 args={fill=#2, path picture={%
\fill[#1] (path picture bounding box.south west) -|
(path picture bounding box.north east) -- cycle;}},
reversed diagonal fill/.style 2 args={fill=#2, path picture={
\fill[#1] (path picture bounding box.north west) |-
(path picture bounding box.south east) -- cycle;}}
}

\begin{document}
\begin{table}
\centering
\begin{tikzpicture}
\matrix[matrix of nodes,
row sep=-\pgflinewidth,
column sep=-\pgflinewidth,
column 2/.style={nodes={text width=4.5cm}},
row 1/.style={nodes={minimum height=7ex}},
align=center,
text centered,
nodes={text width=2cm,
text height=1.5ex,
text depth=.25ex,
minimum height=4ex,
}] (mymatr) {
|[reversed diagonal fill={green}{red}]|\makecell{Let's\\recap} & \makecell{Van Duck's \\rules}\\

Credits to ferahfeza for the diagonal fill and reversed diagonal fill styles.