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},
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={|}{} },
every first column/.style={
column type/.add={!{\vrule width \tableborder}}{}
},
every last column/.style={
column type/.add={}{!{\vrule width \tableborder}}
},
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:
How can I get the header's text to be bold?
Does anyone know of a better way to do what the
every col nocommands do, but in a more general way?
EDIT: Here is the complete code now (It was missing a def). And below the initial config is the code to generate the table.
\usepackage{pgfplotstable}
\usepackage{booktabs}
\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={|}{} },
every first column/.style={
column type/.add={!{\vrule width \tableborder}}{}
},
every last column/.style={
column type/.add={}{!{\vrule width \tableborder}}
},
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},
every head row/.style={
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=\\,
% 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={|}{} },
every first column/.style={
column type/.add={!{\vrule width 1.5pt}}{}
},
every last column/.style={
column type/.add={}{!{\vrule width 1.5pt}}
},
string type,
}
\begin{document}
\pgfplotstabletypeset{
1 & 2 & 4 \\
3 & 4 & 9 \\
}
\end{document}



\documentclass. It doesn't compile for me if I put it into a document, there seem to be some packages missing. – Jake Feb 20 '13 at 19:15