[Tex/LaTex] How to redefine the color of table rules without interfering the content of its cell

colortables

I attempted to change the rule color of my table to red. Unfortunately, the content in the table cell also got interfered as shown in the following figure. The margin frame rules also became red which is not what it should be.

I have no idea what parameters should I redefine to change the table rule color.

alt text


\documentclass[dvips,dvipsnames,rgb]{book}

\usepackage[a4paper,hmargin=10mm,vmargin=40mm,showframe]{geometry}
\usepackage{longtable}
\usepackage{array}
\usepackage{calc}
\usepackage{lscape}
\setlength{\tabcolsep}{2mm}
\setlength{\arrayrulewidth}{2mm}
\newcounter{No}
\renewcommand{\theNo}{\arabic{No}}
\newenvironment{MyTable}[4]%
{%
    \newcolumntype{O}[1]%
    {%
        >{%
            \begin{minipage}%
            {%
                    ##1\linewidth-2\tabcolsep-1.5\arrayrulewidth%
            }%
            \vspace{\tabcolsep}%
         }%
        c%
        <{%
                \vspace{\tabcolsep}%
                \end{minipage}%
         }%
    }%
    \newcolumntype{I}[1]%
    {%
        >{%
            \begin{minipage}%
            {%
                    ##1\linewidth-2\tabcolsep-\arrayrulewidth%
            }%
            \vspace{\tabcolsep}%
         }%
        c%
        <{%
                \vspace{\tabcolsep}%
                \end{minipage}%
         }%
    }%
    \setcounter{No}{0}%comment out this if you want to continuous numbering for all tables.
    \begin{longtable}%
    {%
            |>{\stepcounter{No}\centering\scriptsize\theNo}O{#1}<{}%
            |>{\centering}I{#2}<{\input{\jobname.tmp}}%
            |>{\centering\lstinputlisting{\jobname.tmp}}I{#3}<{}%
            |>{\scriptsize}O{#4}<{}%
            |%
    }%
    \hline\ignorespaces%
}%
{%
    \end{longtable}%
}

\newcommand{\Comment}[1]{&&&#1\tabularnewline\hline}


\usepackage{listings}
\lstset{%
language={PSTricks},
breaklines=true,
basicstyle=\ttfamily\scriptsize,%
keywordstyle=\color{blue},
backgroundcolor=\color{yellow!30}%
}
\usepackage{fancyvrb}


\def\MyRow{%        
        \VerbatimEnvironment%
        \begin{VerbatimOut}{\jobname.tmp}%
}

\def\endMyRow{%
        \end{VerbatimOut}%      
}



\usepackage{pstricks,pst-node}
\newpsstyle{gridstyle}{%
gridwidth=0.4pt,%default: 0.8pt
gridcolor=Red!20,%default: black
griddots=0,%default: 0 
%
gridlabels=3pt,%default: 10pt
gridlabelcolor=Blue,%default: black
%
subgriddiv=5,%default: 5
subgridwidth=0.2pt,%default: 0.4pt
subgridcolor=Green!20,%default: gray
subgriddots=0%default: 0
}

\usepackage{lipsum}

\begin{document}
{\color{Red}%
%\clearpage
%\pagestyle{empty}
%Landscape starts here.
%\begin{landscape}
\begin{MyTable}{0.05}{0.3}{0.3}{0.35}%
%=============
\begin{MyRow}
\pspicture*[showgrid](3,3)
\pnode(1,1){A}
\pnode(3,3){B}
\ncline{A}{B}
\endpspicture
\end{MyRow}
\Comment{\lipsum[1]}
%=============
\begin{MyRow}
\begin{pspicture}[showgrid](3,3)
\psframe*[linecolor=red!30](3,2)
\end{pspicture}
\end{MyRow}
\Comment{\lipsum[2]}
%=============
\begin{MyRow}
\pspicture[showgrid](3,3)
\psframe*[linecolor=green!30](3,2)
\endpspicture
\end{MyRow}
\Comment{\lipsum[3]}
%=============
\begin{MyRow}
\pspicture[showgrid](3,3)
\psframe*[linecolor=yellow!30](3,2)
\endpspicture
\end{MyRow}
\Comment{\lipsum[4]}
%=============
\begin{MyRow}
\pspicture[showgrid](3,3)
\psframe*[linecolor=Maroon!30](3,2)
\endpspicture
\end{MyRow}
\Comment{\lipsum[5]}
%=============
\end{MyTable}
%\end{landscape}
%Landscape stops here.
%\pagestyle{plain}
}%
\end{document}

EDIT 1:

The vertical rule shared by cell (1,2) and cell (1,3) behaves abnormally. It should not be black. 🙂

Best Answer

\documentclass{article}
\usepackage[table]{xcolor}

\begin{document}

\bgroup
\arrayrulecolor{blue!70}
\begin{tabular}{|*6{c|}}\hline
 a & b & c & d & e & f\\\hline
 a & b & c & d & e & f\\\hline
\end{tabular}
\egroup

\end{document}

enter image description here