colortbl rowcolor overtop of @{decl}
You can use the dcolumn
package to easily get the alignment (with the right spacing around \pm
) and the color:
\documentclass{article}
\usepackage{dcolumn}
\usepackage[table]{xcolor}
\newcolumntype{L}{D{,}{{}\pm{}}{1,1}}
\begin{document}
\noindent\begin{tabular}{L}
\multicolumn{1}{c}{value} \\
\hline
1,2 \\
\rowcolor{blue!30} 2,3 \\
\rowcolor{yellow!60} 3,4 \\
\end{tabular}
\noindent\begin{tabular}{L}
\multicolumn{1}{c}{value} \\
\hline
1,2 \\
\rowcolor{blue!30}[0pt] 2,3 \\
\rowcolor{yellow!60}[0pt] 3,4 \\
\end{tabular}
\end{document}
The coloured pannels are laid out before each cell content so you want to make the cell before the @{}
be extended under it and the one after the @{}
to not extend back over it.
Unfortunately I think that means something like:
\documentclass{article}
\usepackage{color}
\usepackage{colortbl}
\begin{document}
\begin{tabular}{l@{$\pm$}r}
\multicolumn{2}{c}{value} \\
\hline
1 & 2 \\
\rowcolor{white}[0pt] 2&3 \\
%\rowcolor{yellow}[0pt]
\multicolumn{1}{>{\columncolor{yellow}[0pt][20pt]}l@{$\pm$}}{3}&
\multicolumn{1}{>{\columncolor{yellow}[0pt]}l}{4}\\
\end{tabular}
\end{document}