I can highlight a row in a table (see below), but it's not centered on the text. Is there a way to fix this?
Code:
\documentclass[11pt]{article}
\usepackage{color, colortbl,booktabs}
\definecolor{Gray}{gray}{0.9}
\begin{document}
\begin{table}[!htbp]
\centering
\begin{tabular}{llccc}
\midrule
&&Mean&Sigma&Total Points \& Costs\\
\midrule
2014 & Unused & 377 & 214 & 1,618,193\\ [0.5ex]
& Deducted & 213 & 141 & 565,792\\ [0.5ex]
& Carryover & 245 & 91 & 1,052,401 \\ [0.5ex]
& Used & 308 & 187 & 1,115,463\\ [0.5ex]
\rowcolor{Gray}
& Costs (dollars) & 590 & 343 & 2,162,652 \\ [0.5ex]
\bottomrule
\end{tabular}
\end{table}
\end{document}
Output:
[0.5ex]
. Either leave them away or if you want more space around the entries, take a look at thecellspace
package. However, you might want to keep in mind that the gray color will not extend completely to the black line since horizontal lines from the booktabs package have a small white spcae around them. (See also: tex.stackexchange.com/q/266438/134144)[0.5ex]
compare the space from the tails of the commas in the last column to the coloured panel below.[0.5ex]
after row termination try with\setlength\extrarowheight{2pt}
in the table preamble .