I had a look at this post on Misaligned multicolumn but it doesn't really solve my problem. I have the code below which is supposed to produce a table with a blue line for the first row and red lines for the other two.
In the table below there should be a single blue line and a single contiguous red line below it, with the numbers all aligned.
Could someone guide me to what I'm doing wrong? I recognize the dire imprecations against vertical lines but in the final output this will present financial information and I thought it would be useful to clearly separate the inflows from the outflows with a colour coded side line.
If anyone can help with the Misplaced \omit error too that would be really helpful

\documentclass{article}
\usepackage{pgfplotstable}
\def\pgfplotstableeach(#1-#2,#3-#4,#5){% columns 1-2 rows 3-4 input 5
\xdef\ACCUM{}%
\foreach \col in {#1,...,#2} {%
\foreach \ro in {#3,...,#4} {%
\toks0=\expandafter{\ACCUM}%
\edef\temp{every row \ro\space column \col/.style}%
\toks1={#5}%
\xdef\ACCUM{\the\toks0 \temp={\the\toks1},}%
}%
}%
\message{setting \meaning\ACCUM^^J}%
\expandafter\pgfplotstableset\expandafter{\ACCUM}%
}
\begin{document}
\pgfplotstableread[row sep=\\,col sep=&,header=false]{%
1 & 2 & 3 & 4\\%
5 & 6 & 7 & 8\\%
9 & 10 & 11 & 12\\%
}\mytable
\pgfplotstableset{
outline/.style={postproc cell content/.style={@cell content=\fbox{##1}}},
vblue/.style={postproc cell content/.style={@cell content=\multicolumn{1}{!{\color{blue}\vrule width 2pt height 1ex}l}{##1}}},
vred/.style= {postproc cell content/.style={@cell content=\multicolumn{1}{!{\color{red} \vrule width 2pt height 2ex}l}{##1}}}
}
\pgfplotstableeach(0-0,1-2,{vred})
\pgfplotstableeach(0-0,0-0,{vblue})
\pgfplotstabletypeset[
debug,
column name={},
every row 2 column 1/.style={outline},
every row 1 column 0/.style={vred},
every row no 0/.style={after row={\rule{0pt}{2em}}}
]\mytable
\end{document}


\hspace{1cm}the{\color...}group before that is a coloured rule and##1is (apparently) the original cell contents which must go through two levels of macro definition internally hence requiring a doubled#. The main point is that it is too late to change the cell preamble with multicolumn so you need to put the vrule in the cell content and space it "by hand" to separate it from the digits in the cell. – David Carlisle Oct 31 '12 at 21:34