You can also do this without changing the data entries by using the collcell package.
Below I have defined the R column type which divides the number by the value specified in \Factor, and prints the number using \pgfmathprintnumber which allows for formatting the number. The options [precision=3] have been applied to only print three decimal digits. The table on the left is using the r column type, and the one on the right is using the R column type.

Notes:
Manually Specify end of Header:
This version require one to add \StartingHeader at the start of the header (which disables the application of the factor to the data entry), and \DoneWithHeader at the end of the header so that subsequent data values are divided by \Factor. Automated version is below.
Code:
\documentclass{article}
\usepackage{booktabs}
\usepackage{collcell}
\usepackage{pgf}
\usepackage{etoolbox}
\newcommand{\Factor}{105}%
\newcommand{\FactorCell}[1]{%
\iftoggle{DoneWithHeader}{%
\pgfmathsetmacro{\ComputedValue}{#1/\Factor}%
\pgfmathprintnumber[,fixed,precision=3]{\ComputedValue}%
}{%
#1% Still working on header
}%
}%
\newtoggle{DoneWithHeader}%
\togglefalse{DoneWithHeader}%
\newcommand{\StartingHeader}{\global\togglefalse{DoneWithHeader}}%
\newcommand{\DoneWithHeader}{\global\toggletrue{DoneWithHeader}}%
\newcolumntype{R}{>{\collectcell\FactorCell}r<{\endcollectcell}}
\begin{document}
\begin{tabular}{rrrr}
\toprule
& A & B & C \
\midrule
1 & 122 & 133 & 156 \
2 & 112 & 135 & 155 \
3 & 150 & 139 & 158 \
4 & 145 & 135 & 159 \
5 & 150 & 130 & 200 \
\bottomrule
\end{tabular}%
\hspace{2.0ex}
\begin{tabular}{rRRR}
\toprule\StartingHeader
& A & B & C \
\midrule\DoneWithHeader
1 & 122 & 133 & 156 \
2 & 112 & 135 & 155 \
3 & 150 & 139 & 158 \
4 & 145 & 135 & 159 \
5 & 150 & 130 & 200 \
\bottomrule
\end{tabular}%
\end{document}
Automated Method:
If you will always have a \toprule before the header row, and a \midrule prior to the data entries, you can automate the setting of \StartingHeader and \DoneWithHeader. With this version, the only change required is switching the data column type form r to R.
The MWE below produces output identical to the above.
References:
- I needed to add
\noexpand in the redefinition of \toprule and \midrule. See Wrapping \cmidrule in a macro for more details. It seems that \toprule and \midrule have a similar issue.
Code:
\documentclass{article}
\usepackage{booktabs}
\usepackage{collcell}
\usepackage{pgf}
\usepackage{etoolbox}
\usepackage{letltxmacro}
\newcommand{\Factor}{105}%
\newcommand{\FactorCell}[1]{%
\iftoggle{DoneWithHeader}{%
\pgfmathsetmacro{\ComputedValue}{#1/\Factor}%
\pgfmathprintnumber[precision=3]{\ComputedValue}%
}{%
#1% Still working on header
}%
}%
\newtoggle{DoneWithHeader}%
\togglefalse{DoneWithHeader}%
\newcommand{\StartingHeader}{\global\togglefalse{DoneWithHeader}}%
\newcommand{\DoneWithHeader}{\global\toggletrue{DoneWithHeader}}%
\LetLtxMacro\OldTopRule\toprule
\def\toprule{\StartingHeader\noexpand\OldTopRule}
\LetLtxMacro\OldMidRule\midrule
\def\midrule{\DoneWithHeader\noexpand\OldMidRule}
\newcolumntype{R}{>{\collectcell\FactorCell}r<{\endcollectcell}}
\begin{document}
\begin{tabular}{rrrr}
\toprule
& A & B & C \
\midrule
1 & 122 & 133 & 156 \
2 & 112 & 135 & 155 \
3 & 150 & 139 & 158 \
4 & 145 & 135 & 159 \
5 & 150 & 130 & 200 \
\bottomrule
\end{tabular}%
\hspace{2.0ex}
\begin{tabular}{rRRR}
\toprule
& A & B & C \
\midrule
1 & 122 & 133 & 156 \
2 & 112 & 135 & 155 \
3 & 150 & 139 & 158 \
4 & 145 & 135 & 159 \
5 & 150 & 130 & 200 \
\bottomrule
\end{tabular}%
\end{document}
tabular, you can copy-and-paste the result into a spreadsheet package (like Excel), perform the operation and paste it back into TeX... Is this a possibility? – Werner Jul 31 '12 at 05:30