# Make numbers in pgfplotstable bold without changing width

I wished to bold some numbers in a table I am showing with pgfplotstable. The manual and this answer

suggest using

every row 2 column 1/.style={ %Row number just for example
postproc cell content/.style={
@cell content/.add={$\bf}{$}
}
},


However, when I do that it puts the numbers out of alignment because the bolded ones are too wide.

After reading a bit about typography, I've concluded that what I want is to display the numbers using a font featuring tabular figures, with duplexing so that bold has the same widths.

I looked at this answer for normal tabular tables, and it shows exactly what I want. However when I tried:

every row 4 column 1/.style={ %Row number just for example
postproc cell content/.style={
}
},


There was no change. It didn't even make it bold at all.

### Minimal verifiable example:

\documentclass{article}
\usepackage{pgfplotstable}

\begin{document}
\pgfplotstabletypeset[
precision=5, fixed zerofill=true,
every row 2 column 1/.style={
postproc cell content/.append style={
@cell content/.add={$\bf}{$}
}
}
]{
a b
5 1.23
6 1.6311
7 4.231
9 2.10144
}
\end{document}


Problem you are running into, and why the \fontseries command isn't working for you, is that pgfplotstables formats all numbers in math mode -- like if they were between \$ signs. \fontseries does not effect the fonts used in math mode. What you can do instead to change the font used in math mode (for that cell) follows. It is based on the answer to a similar question about making pgfplotstables uses \sffamily

One can declare a version of the normal font that is bold (b) not bold-extended (bx)

using

\DeclareMathVersion{tabularbold}
\SetSymbolFont{operators}{tabularbold}{OT1}{cmr}{b}{n}


in the preamble.

Then you can switch to it for a section using \mathversion{tabularbold}, as in

every row 2 column 1/.style={
postproc cell content/.append style={
}
}


### Full example:

\documentclass{article}
\usepackage{pgfplotstable}

\DeclareMathVersion{tabularbold}
\SetSymbolFont{operators}{tabularbold}{OT1}{cmr}{b}{n}
\begin{document}
\pgfplotstabletypeset[
precision=5, fixed zerofill=true,
every row 2 column 1/.style={
postproc cell content/.append style={