[Tex/LaTex] How to use \multicolumn in a \pgfplotstable table

multicolumnpgfplotstabletables

In my experiments with pgfplotstable, I've run into some bumps:

Problem

I cannot seem to properly add a \multicolumn{}{}{} to my portable graphics format plot table.

I've viewed the following questions:

Example

\documentclass{article}
\usepackage{fontspec}
\usepackage{booktabs}
\usepackage{pgfplotstable}
\usepackage{multicol}% <-- Don't think this is needed.
\pgfplotstableset{% Global config
    every head row/.style={before row=\toprule,after row=\midrule},
    every last row/.style={after row=\bottomrule},
    col sep=&,
    row sep=\\,
    column type=l,
    column type={>{\fontseries{bx}\selectfont\color{orange}}l}, %see sec 2.6 for defining column types
    string type,
    postproc cell content/.append style={ % see sec 3.2
    /pgfplots/table/@cell content/.add={\fontseries{\seriesdefault}\selectfont\color{black}}{}}
}%

\begin{document}
\pgfplotstabletypeset{%
col1 & col2 & col3\\ 
here & more & stuff\\
for & good & looks \\ % \multicolumn{2}{c}{good looks} % <-- Replacing the cells "good" and look" with this causes problems
}%
\end{document}

Best Answer

I think it is better to give a true minmal working example. There is much stuff, which has nothing to do with the problem...

Maybe, you are looking for something like this:

\pgfplotstableset{
every row no 0/.append style={after row={
for & \multicolumn{2}{c}{\color{red} good   looks} \\
}},
}

enter image description here

% arara: lualatex

%\documentclass{article}
\documentclass[margin=5mm]{standalone}
\usepackage{fontspec}
\usepackage{booktabs}
\usepackage{pgfplotstable}

%\usepackage{multicol}% <-- Don't think this is needed.

\pgfplotstableset{% Global config
    every head row/.style={before row=\toprule,after row=\midrule},
    every last row/.style={after row=\bottomrule},
    col sep=&,
    row sep=\\,
    column type=l,
    column type={>{\fontseries{bx}\selectfont\color{orange}}l}, %see sec 2.6 for defining column types
    string type,
    postproc cell content/.append style={ % see sec 3.2
    /pgfplots/table/@cell content/.add={\fontseries{\seriesdefault}\selectfont\color{black}}{}
},
%
}%

\begin{document}
\pgfplotstableset{
every row no 0/.append style={after row={
for & \multicolumn{2}{c}{\color{red} good   looks} \\
}},
}



\pgfplotstabletypeset{%
col1 & col2 & col3\\ 
here & more & stuff\\
for & good  & looks \\ % \multicolumn{2}{c}{good looks} \\% <-- Replacing the cells "good" and look" with this causes problems
}%
\end{document}
Related Question