I have the following table :
It uses \rowcolor
, \multicolumn
, \multirow
but it also has a wide white spacing between the cases.
I need the title "Cobertura del transporte en el municipio de Monterrey" to be properly centered, respecting the 2 cases width, the padding and the space between the left, right and the cases below it.
I also need to combine the two green cases rounded by the red ellipse and containing the "91.4%" value. These two cases would then become one (cf. the \multirow
attempt below) green case spanning between the two rows and respecting the height and padding.
I've been trying to get my table right with this method, only it does not seem to apply to my particular example because of the white spacing.
The code for this table is the following :
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{color}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{mdframed}
\usepackage{multirow}
\usepackage{tikz,pgfplots}
\usepackage{colortbl}
\usetikzlibrary{shapes}
%------Column types--------------
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
%------Space between cases-------
\makeatletter
\newcommand{\thickhline}{%
\noalign {\ifnum 0=`}\fi \hrule height 2pt
\futurelet \reserved@a \@xhline
}
\newcolumntype{+}{@{\hskip\tabcolsep\vrule width 2pt\hskip\tabcolsep}}
\makeatother
%-------Colors--------------------
\definecolor{table1}{RGB}{255,129,54}
\definecolor{table2}{RGB}{41,148,178}
\definecolor{table3}{RGB}{255,129,54}
\definecolor{table4}{RGB}{220,220,77}
\definecolor{table5}{RGB}{58,58,58}
\begin{document}
\begin{table}[!ht]
\centering
\color{white}\sffamily
\begin{tabular}{L{3cm}+C{3cm}+C{3cm}+C{3cm}}
\rowcolor{table5}
Otra cosa & \multicolumn{2}{c}{Cobertura del transporte en el municipio de Monterrey} & Otra cosa\\
\thickhline
\rowcolor{table4}
- & \cellcolor{table3}\textcolor{table5}{Primer Cuadro} & \multirow{2}{*}{\textcolor{table5}{91.4\%}} & -\\
\thickhline
\rowcolor{table4}
- & \cellcolor{table3}\textcolor{table5}{Centro (Poniente)} & & -\\
\thickhline
\rowcolor{table4}
- & \cellcolor{table3}\textcolor{table5}{Oeste} & \textcolor{table5}{90.1\%} & -\\
\hline
\end{tabular}
\end{table}
\end{document}
Note : I obviously tried replacing the line
\multicolumn{2}{c}{Cobertura del transporte en el municipio de Monterrey}
by this one :
\multicolumn{2}{C{6cm}}{Cobertura del transporte en el municipio de Monterrey}
but it did not provide anything good :
Does anyone has a proper solution for this issue?