color a column red in a table
Your example works if the xcolor
instead of the color
package is loaded while specifying the table
option (which loads the colortbl
package in a suitable way).
Regarding your second point, viz., about the color block impinging on the black line: This impression may be an artifact of limited screen resolution; it's definitely apparent in the .png
image posted here, but that's a raster font image with limited resolution. The uneven line thickness thing appears to go away if you (a) increase the resolution or (b) make a paper hardcopy.
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{bigstrut}
\begin{document}
\begin{table}
\centering
\begin{tabular}{c>{\columncolor{red}}cr}
a & b & c \bigstrut[b]\\
\hline
1 & 2 & 3\\
4 & 5 & 6 \bigstrut[t]\\
\hline
7 & 8 & 9\\
\end{tabular}
\end{table}
\end{document}
You can help the renderer by placing the rules over a single red panel, but to do that you have to give TeX a bit more help.
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{bigstrut}
\begin{document}
\begin{table}
\centering
\begin{tabular}{ccr}
\omit&\omit
{\color{red}%
\leaders\hbox{\smash{\vrule height 2pt depth 55pt}}\hskip 0pt plus 1filll%
}%
&
\omit\cr
a & b& c \bigstrut[b]\\
\hline
1 & 222jjj2 & 3\\
4 & 5 & 6 \bigstrut[t]\\
\hline
7 & 8 & 9\\
\end{tabular}
\end{table}
\end{document}