I have a table with numbers that I have aligned using the S column type provided by the siunitx
package. I need to make one of the table elements red, but when I do that, the number that is red is no longer aligned.
What is the right way to do this? MWE below.
\documentclass{article}
\usepackage{siunitx}
\usepackage[]{xcolor}
\begin{document}
\begin{table} \centering
\caption{Table with \texttt{c} column type.}
\begin{tabular}{cc}
\hline
Symbol & \multicolumn{1}{c}{Value} \\
\hline
$\pi$ & 3.141592654 \\
$2\pi$ & 6.283185307 \\
$4\pi$ & 12.56637061 \\
$8\pi$ & {\color{red}25.13274123} \\
$e$ & 2.71828182845904524 \\
$\sqrt{2}$ & 1.41421356237309505 \\
\hline
\end{tabular}
\end{table}
\begin{table} \centering
\caption{Table with \texttt{S} column type.}
\begin{tabular}{cS}
\hline
Symbol & \multicolumn{1}{c}{Value} \\
\hline
$\pi$ & 3.141592654 \\
$2\pi$ & 6.283185307 \\
$4\pi$ & 12.56637061 \\
$8\pi$ & {\color{red}25.13274123} \\
$e$ & 2.71828182845904524 \\
$\sqrt{2}$ & 1.41421356237309505 \\
\hline
\end{tabular}
\end{table}
\end{document}