For a solution which still uses \rowcolor
and stuff see @AboAmmar's answer. But if you have the freedom of formatting your tables yourself, consider ditching the colours and vertical rules and use booktabs
. Also text like in the "Description" column looks better, if it's left aligned. And consider using p
columns instead of m
.
\documentclass[]{article}
\usepackage{array}
\usepackage{booktabs}
\begin{document}
\begin{table} [h]
\centering
\caption{}
\begin{tabular}{ >{\centering\arraybackslash} p{3cm} p{3cm} >{\centering\arraybackslash} p{4cm} }
\toprule
Variable & Description & Value \\
\midrule
Variable & Description which really needs the full width& Value \\
Variable & Description & Value \\
Variable & Description & Value \\
\bottomrule
\end{tabular}
\end{table}
\end{document}

And generally values shouldn't be that wide that you need multiple lines to format them. Instead consider using a S
-type column provided by siunitx
which horizontally aligns the numbers to have the same digits beneath each other (You need to hide the table header from that by enclosing it with {Value}
). And variable names shouldn't be that wide, too, so perhaps use the c
or the l
specifier there. Additionally if each variable name is to be typeset in math-mode, you can use >{\(}c<{\)}
to change that column to use math mode. A \hbox
can be used to hide something from that effect (or \text
provided by amsmath
).
\documentclass[preview,border=2mm]{standalone}
\usepackage{array}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table} [h]
\centering
\caption{}
\begin{tabular}{ >{\(}c<{\)} p{3cm} S }
\toprule
\hbox{Variable} & Description & {Value} \\
\midrule
x & Description which really needs the full width& 0.12 \\
\sigma & Description & 10.51 \\
\delta & Description & 15.43 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}

\documntclass{...}
and ending with\end{document}
(ii) i cant reproduce your problem. welcome to tex.se! – Zarko Mar 20 '18 at 21:01\documentclass{article}\usepackage[table]{xcolor}\usepackage{array}
as a preamble in TL2017 does reproduce the problem. – Skillmon Mar 20 '18 at 21:04\\[0.5cm]
. If you leave that[0.5cm]
out, everything works fine. – Skillmon Mar 20 '18 at 21:04\\
but without the optional argument[0.5cm]
. – Skillmon Mar 20 '18 at 21:09