I want to create a table using the pgfplotstable package. I've managed to get 95% of the formatting I want using the following:

\usepackage{pgfplotstable}
\usepackage{booktabs}

% global settings
\pgfplotstableset{
after row={\hline},
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=\\,
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={|}{} },
every first column/.style={
},
every last column/.style={
},
string type,
}


Even though there are many every col no, which I don't like, it still works almost perfectly. The only thing I'm missing is to put the header's text in bold. If I try to force it to bold in the actual table it doesn't compile, and I'm not able to change the content of the row to bold. So with this code I ask 2 questions:

1 - Hown can I get the header's text to be bold?

2 - Does anyone know of a better way to do what the every col no commands do, but in a more general way?

EDIT: Here is the complete code now (It was missing a def). And bellow the initial config is the code to generate the table.

\usepackage{pgfplotstable}
\usepackage{booktabs}
\def\tableborder{1.5pt}

% global settings
\pgfplotstableset{
after row={\hline},
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=\\,
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={|}{} },
every first column/.style={
},
every last column/.style={
},
string type,
}


With this the table is generated. Note that this is only a portion of the actual document and the table is a fake.

\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 & &\\
}


Here is the result. I want the text in the header to be bold, and the column lines to go all the way on all columns

EDIT Nº2:

Ok now here is a sample of a compilable code (stand alone), but now it is refusing to paint the header row. Please help.

\documentclass[12pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}

\usepackage{pgfplotstable}
\usepackage{booktabs}
\def\tableborder{1.5pt}

% global settings
\pgfplotstableset{
after row={\hline},
before row={
\noalign{\hrule height 1.5pt}
},
after row={
\hline
},
},
every last row/.style={
after row=\noalign{\hrule height 1.5pt}
},
col sep = &,
row sep=\\,
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={|}{} },
every first column/.style={
},
every last column/.style={
},
string type,
}

\begin{document}
\pgfplotstabletypeset{
1 & 2 & 4 \\
3 & 4 & 9 \\
}
\end{document}

-
Can you edit your question to show a complete compilable example rather than a code fragment? See minimal working example (MWE). –  Alan Munn Feb 20 at 17:55
@AlanMunn I'm trying to do that. But I'm doing so many changes in the document that it doesn't compile anymore. –  morcillo Feb 20 at 18:13
@AlanMunn And I have no idea anymore where things are going to hell. –  morcillo Feb 20 at 18:13
So start small, and work your way up. This way you can more easily identify where things have gone wrong. If you get to a point where you have a small change that causes an error, you can post that document and then people can help you. There's not much incentive for people here to do that if you won't yourself. –  Alan Munn Feb 20 at 18:32
@morcillo: It's best if you make a complete minimal example document, starting from \documentclass. It doesn't compile for me if I put it into a document, there seem to be some packages missing. –  Jake Feb 20 at 19:15

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


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},
postproc cell content/.append style={
}

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

\end{document}


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},
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=\\,
%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={
},
string type,
postproc cell content/.append style={
}
}

\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}


-

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 & & \\
}

-