Graphics, Figures & TablesRow color problem

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Saszalez
Posts: 5
Joined: Wed May 23, 2018 10:40 am

Row color problem

Post by Saszalez »

Hello everyone.

I have a problem with the color of the rows and I have searched and tried several solutions and I have not been successful. I can set the color of the row without problem, but the colo does not occupy the entire row, leaving a margin up and down unpainted. How can I make it to paint everything?

I use MacTex with Texmaker.

Thank you very much.

Code: Select all

\documentclass[12pt,a4paper,oneside]{report}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage[T1]{fontenc}
\usepackage[scaled]{helvet}
\normalfont
\usepackage{graphicx}
\usepackage{float}
\usepackage{booktabs}
\usepackage{colortbl}
\usepackage{caption}
\captionsetup{justification=centering,font={footnotesize},skip=0pt}
\usepackage{color}
\definecolor{verde}{RGB}{40,112,60}
\definecolor{blanco}{RGB}{254,254,254}

\begin{document}

\begin{table}[H]
\centering
\resizebox{\textwidth}{!}{
\begin{tabular}{cccccccccccccc}
\toprule[0.5mm]
\multicolumn{14}{>{\columncolor{verde}}c}{\textcolor{blanco}{\textbf{Parámetros climáticos promedio}}}\\
\midrule[0.3mm]
Mes & Ene & Feb & Mar & Abr & May & Jun & Jul & Ago & Sep & Oct & Nov & Dic & Anual\\
\midrule[0.1mm]
Máx. media ($^\circ$C) & 15 & 15 & 16 & 17 & 15 & 14 & 14 & 15 & 16 & 18 & 18 & 17 & 15,8\\
Media ($^\circ$C) & 9 & 9 & 9 & 8,5 & 6,5 & 5,5 & 5,5 & 5 & 6 & 6,5 & 9,5 & 10 & 10\\
Mín. Media ($^\circ$C) & 3 & 3 & 2 & 0 & -2 & -3 & -4 & -3 & -1 & 1 & 2 & 3 & 0,1\\
Precip. (mm) & 92 & 86 & 55 & 13 & 3 & 1 & 1 & 3 & 10 & 20 & 38 & 75 & 397\\  
Días $\geq$ 1mm & 17 & 16 & 12 & 5 & 1 & 0 & 0 & 1 & 2 & 5 & 7 & 14 & 80\\  
\bottomrule[0.5mm]
\end{tabular}
}
\caption{Datos climáticos promedio de San Cristóbal de Lípez}
\end{table}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10397
Joined: Mon Mar 10, 2008 9:44 pm

Row color problem

Post by Stefan Kottwitz »

Hi Saszalez,

welcome to the forum!

Here is a quick way:

Code: Select all

\renewcommand{\aboverulesep}{0pt}
\renewcommand{\belowrulesep}{0pt}
Stefan
LaTeX.org admin
Saszalez
Posts: 5
Joined: Wed May 23, 2018 10:40 am

Row color problem

Post by Saszalez »

Hi Stefan.

Thank you very much for your help. I was crazy to find a solution, and the truth was that it was easy.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10397
Joined: Mon Mar 10, 2008 9:44 pm

Row color problem

Post by Stefan Kottwitz »

No problem! Whenever you got a LaTeX related question or a code doesn't work as desired, just post here in the forum. Often we can quickly provide help that isn't difficult, and it saves you time so you can focus on working on your content.

Stefan
LaTeX.org admin
Post Reply