[Tex/LaTex] Changing font color in a table adding unwanted extra spacing

colorfontsspacingtables

I haven't been able to find a solution, so I'm hoping for any suggestions. When I try to change the font color in my table, I get extra spacing above and below the lines with the color-changed font. Any way to work around this?

\begin{tabular}{>{\raggedright}p{0.5cm}>{\raggedright\arraybackslash}p{9cm}}
\ding{47}                & Test 1 \\
{\color{new}{\ding{47}}} & {\color{new}{Test 2}} \\
{\color{new}{\ding{47}}} & {\color{new}{Test 3}}\\
{\color{new}{\ding{47}}} & {\color{new}{Test 4}} \\
\ding{47}                & Test 5\\
\end{tabular}\

An image of what's happening:

enter image description here

Best Answer

Use \textcolor instead:

\documentclass{article}
\usepackage{pifont}
\usepackage{array}
\usepackage{xcolor}

\colorlet{new}{red}

\begin{document}

\begin{tabular}{>{\raggedright}p{0.5cm}>{\raggedright\arraybackslash}p{9cm}}
\ding{47}                & Test 1 \\
\textcolor{new}{\ding{47}} & \textcolor{new}{Test 2} \\
\textcolor{new}{\ding{47}} & \textcolor{new}{Test 3} \\
\textcolor{new}{\ding{47}} & \textcolor{new}{Test 4} \\
\ding{47}                & Test 5 \\
\end{tabular}

\end{document}

enter image description here

Or \leavevmode before \color:

\documentclass{article}
\usepackage{pifont}
\usepackage{array}
\usepackage{xcolor}

\colorlet{new}{red}

\begin{document}

\begin{tabular}{>{\raggedright}p{0.5cm}>{\raggedright\arraybackslash}p{9cm}}
\ding{47}                & Test 1 \\
\leavevmode\color{new}\ding{47} & \leavevmode\color{new}Test 2 \\
\leavevmode\color{new}\ding{47} & \leavevmode\color{new}Test 3 \\
\leavevmode\color{new}\ding{47} & \leavevmode\color{new}Test 4 \\
\ding{47}                & Test 5\\
\end{tabular}

\end{document}
Related Question