[Tex/LaTex] How to wrap the text in certain columns using pgfplotstable

pgfplotstable

Issue

How can I specify the column width without explicitly knowing how many columns there will be in my table?

In the pgfplotstable manual Revision 1.12 (2015/01/31) on page 35, there is a section about typesetting. One of the pictures looks like this (also with a nice overfull line, 😀 ):
enter image description here

The line

\begin{tabular}{ccc}%

I would like to effectively make into

\begin{tabular}{p{.4\textwidth}ll}

BUT Using pgfplotstable macros.

Caveat: I do not know how many columns there are (working with a global definition for many tables that have varying numbers of columns). This means I'd really like an answer that allows more abstraction from the standard commands.

Ideas

If I wanted to make the first column have a specific width, say 40% of main text box, I would have a few options.

All of the ways I know how to do this are:

\begin{minipage}{.4\textwidth}
some cell text
\end{minipage}

\parbox{.4\textwidth}{%
some cell text
}%

\begin{tabular}{ p{.4\textwidth} }
some cell text
\end{tabular}

Pseudo Solution

every column 0/.style={postproc cell content/.style={@cell content=\parbox{.4\textwidth}{##1}}},

Example Code

\documentclass{article}
\usepackage{fontspec}
\usepackage{booktabs}
\usepackage{pgfplotstable}
\pgfplotstableset{% Global config
    every head row/.style={before row=\toprule,after row=\midrule},
    every last row/.style={after row=\bottomrule},
    col sep=&,
    row sep=\\,
    header=has colnames,
    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\\
}%
\end{document}

Best Answer

If you know the name or the number of the column you can specify only that property and the rest will still assume c so you don't need the number of columns.

\documentclass{article}
\usepackage{booktabs}
\usepackage{pgfplotstable}

\begin{document}
\pgfplotstabletypeset[
string type,
display columns/0/.style={column type={p{.4\textwidth}}},% columns/col1/.style also works
col sep=&,row sep=crcr,
]{%
col1 & col2 & col3\\ 
here & more & stuff\\
for & good & looks\\
}%
\end{document}

enter image description here