Pgfplotstable header in bold

I know this post is old but I just figured this out and was too excited not to share...

Pertaining to your first question about bold headers I can offer the following. Before typesetting the table, specify bold font in the column type using

column type={>{\fontseries{bx}\selectfont}c} %see sec 2.6 for defining column types

This should set all entries in your table to bold font. To leave only the headers bold, you can then post-process every cell's content using

postproc cell content/.append style={ % see sec 3.2
/pgfplots/table/@cell content/.add={\fontseries{\seriesdefault}\selectfont}{}}

This works because the second block of code does not apply to header cells, so we can first set everything bold, then reset the other (non-header) cells to normal font. See the sections in comments in the pgfplotstable manual for more information.

Here is a MWE

\documentclass{article}
\usepackage{pgfplotstable}

\begin{document}

\pgfplotstableset{% set global options
format=inline,
string type,
col sep={&}, row sep={\\},
column type={>{\fontseries{bx}\selectfont\centering\arraybackslash}c},
every head row/.style={after row=\hline},
postproc cell content/.append style={
/pgfplots/table/@cell content/.add={\fontseries{\seriesdefault}\selectfont}{}}
}

\pgfplotstabletypeset{% The input table
H1&H2&H3 \\
data1&data2&data3 \\
moredata1&moredata2&moredata3 \\
}

\end{document}

MWE

EDIT:

Here is the code embedded in your formatted table. I commented out the every col no <index>/.style and replaced that block simply with column type={<options>}. This allows you to specify column type for every column. Since you wanted a different specification for the first and last columns, you must manually specify those.

\documentclass{article}
\usepackage{pgfplotstable}
\usepackage{booktabs,colortbl}
\begin{document}
\def\tableborder{1.5pt}

% global settings
\pgfplotstableset{
after row={\hline},
every head row/.style={
before row={
\rowcolor{lightgray}
\noalign{\hrule height \tableborder}
},
after row={
\hline
},
},
every last row/.style={
after row=\noalign{\hrule height \tableborder}
},
col sep = &,
row sep=\\,
% column type/.add={}{\vrule width \tableborder},
%every col no 1/.style={ column type/.add={|}{} },
%every col no 2/.style={ column type/.add={|}{} },
%every col no 3/.style={ column type/.add={|}{} },
%every col no 4/.style={ column type/.add={|}{} },
%every col no 5/.style={ column type/.add={|}{} },
column type={|>{\fontseries{bx}\selectfont}c},
every first column/.style={
column type={!{\vrule width \tableborder}>{\fontseries{bx}\selectfont}c} % removed /.add so you can replace the format rather than append to it.
},
every last column/.style={
column type/.add={}{!{\vrule width \tableborder}}
},
string type,
postproc cell content/.append style={
/pgfplots/table/@cell content/.add={\fontseries{\seriesdefault}\selectfont}{}
}
}


\pgfplotstabletypeset{
person & singEnglish & singGaeilge & pluralEnglish & pluralGaeilge\\
1st & at me & agam & at us & againn\\
2st & at you & agat & at you & agaibh\\
3st & at him & aige & at them & acu\\
& at her & aici & &\\
}
\end{document}

mwe_table_edit


Pgfplotstable comes with quite limited support to modify the content of header cells. In fact, the only practical way to assign its content is to modify the column name. There are two methods to modify the column name: the first is direct assignment (unsuitable here) and the second is assign column name which allows to modify an existing column name. Since header rows contain nothing but column names, you can use this to make it bold:

\documentclass{standalone}

\usepackage{pgfplotstable}
\usepackage{booktabs}
\usepackage{array}
\usepackage{colortbl}

\begin{document}

\pgfplotstabletypeset[
    assign column name/.style={/pgfplots/table/column name={\textbf{#1}}},
]
{
first second third
1 2 3
4 5 6
}
\end{document}

In this context, #1 is the "normal" column name. The key is expected to modify column name.

enter image description here


Ok this isn't a good solution, I really don't like it since it's really speciffic and the intention was to make things easier for the user, but anyway, here it is:

\pgfplotstabletypeset
[columns/col1/.style{column name=\textbf{col1}},
columns/col2/.style{column name=\textbf{col2}},
columns/col3/.style{column name=\textbf{col3}},
columns/col4/.style{column name=\textbf{col4}},
columns/col5/.style{column name=\textbf{col5}}
]{
col1 & col2 & col3 & col4 & col5 \\
1st & at me & agam & at us & againn \\
2st & at you & agat & at you & agaibh \\
3st & at him & aige & at them & acu \\
& at her & aici & & \\
}