While following some company's graphic guidelines, I tried to make a custom tabular using tikz.
Here is the MWE:
\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{xcolor}
\definecolor{CustomBlue}{RGB}{13,88,129}
\definecolor{CustomBlue2}{RGB}{90,111,131}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{table}[h]
\centering
\newcommand{\filler}[1]{
\coordinate[xshift=.5cm] (sw) at (#1.south west);
\coordinate[xshift=-0.35cm, yshift=-1pt] (1) at (#1.south east);
\filldraw[white, ultra thin, transform canvas={yshift=0.5pt}] (#1.south east) -- (sw) -- ++(0,-1pt) -- (1) -- ++(0,-1pt) -- ++(0.35,0) --cycle;
}
\tikzset{header/.style={draw, fill, rectangle, color=CustomBlue, text=white, minimum width=3cm, minimum height=.5cm, text width=3.8cm, align=left}}
\tikzset{table/.style={draw, fill, rectangle, color=#1, text=black, minimum width=3cm,text width=3.8cm, align = left},
table/.default={CustomBlue!20}}
\begin{tikzpicture}
\node[header] (A1) {\begin{tabular}{l}
\textbf{Some header}
\end{tabular}};
\node[table=CustomBlue2!70, text=white, below=0 of A1](A2) {
\begin{tabular}{l}
Some item \\
Another item
\end{tabular}
};
\filler{A1}
\node[table=CustomBlue2!70, text= white, below=0 of A2] (A3) {
\begin{tabular}{l}
A total
\end{tabular}
};
\filler{A2}
\node[header, right= .15cm of A1] (B1) {\begin{tabular}{l}
\textbf{Another header}
\end{tabular}};
\node[table, below=0 of B1] (B2) {
\begin{tabular}{l}
Some value \\
Some other value
\end{tabular}
};
\filler{B1}
\node[table, below=0 of B2] (B3) {
\begin{tabular}{l}
~
\end{tabular}
};
\filler{B2}
\node[header, right= .15cm of B1] (C1) {
\bfseries
\begin{tabular}{l}
Last header
\end{tabular}
};
\node[table, below=0 of C1] (C2) {
\begin{tabular}{l}
Almost the last item\\
The last one
\end{tabular}
};
\filler{C1}
\node[table, below=0 of C2] (C3) {
\begin{tabular}{l}
Oh, forgot that one
\end{tabular}
};
\filler{C2}
\end{tikzpicture}
\end{table}
\end{document}
That code is somewhat inelegant and long (not really reusable several times in a document). I'm trying to make a custom tabular environment which would basically look like:
\begin{customTabular}{l|l|l}
Some header & Another header & Last header\\
\customLine\\
Some item & Some value & Almost the last item\\
Another item & Some other value & The last one\\
\customLine \\
A total & & Oh, forgot that one
\end{customTabular}
Any hint on how I may do that? (I'm not really asking for a full code, but rather guidelines). Many thanks!


