# spreadtab insert multiple values to a cell

\begin{spreadtab}{{tabular}{rrrr}}
\toprule
& @A              & @B            & @C         \\
\midrule
1     & 33 122   & 133/\Factor   & 156/\Factor \\
2     & 66 112   & 135/\Factor   & 155/\Factor \\
3     & 77 150   & 139/\Factor   & 158/\Factor \\
4     & 55 145   & 135/\Factor   & 159/\Factor \\
5     & 44 150   & 130/\Factor   & 200/\Factor \\
\bottomrule


FP Evaluation results in multiple values!

Is there a trick that i can use to insert multiple values ?

-
Can you please explain why do you want to have multiple values in one cell? A description of your goal could be useful. – Gonzalo Medina Jul 31 '12 at 6:14
i need to display feature numbers selected by feature selection algorithm on one column. and the amount of features can vary – user581544 Jul 31 '12 at 6:19
Related Question: divide table cells by a certain amount. – Peter Grill Jul 31 '12 at 8:30

I am not sure if this is what you need, but you can treat those values as text entries:

\documentclass{article}
\usepackage{numprint}
\usepackage{booktabs}

\newcommand\Factor{105}

\begin{document}

\renewcommand\STprintnum[1]{\numprint{#1}}
\nprounddigits{3}
\toprule
& @A              & @B            & @C         \\
\midrule
1     & @33 122   & 133/\Factor   & 156/\Factor \\
2     & @66 112   & 135/\Factor   & 155/\Factor \\
3     & @77 150   & 139/\Factor   & 158/\Factor \\
4     & @55 145   & 135/\Factor   & 159/\Factor \\
5     & @44 150   & 130/\Factor   & 200/\Factor \\
\bottomrule

\end{document}


-

You can also adapt the solutions form divide table cells by a certain amount for this case. Here is the automated version which uses the r column type for the column where you don't want the factor applied and the R column type to apply the factor. The first table here uses {rrrr} and the second table uses {rrRR} columns.

## Code:

\documentclass{article}
\usepackage{booktabs}
\usepackage{collcell}
\usepackage{pgf}
\usepackage{etoolbox}
\usepackage{letltxmacro}

\newcommand{\Factor}{105}%
\newcommand{\FactorCell}[1]{%
\pgfmathsetmacro{\ComputedValue}{#1/\Factor}%
\pgfmathprintnumber[precision=3]{\ComputedValue}%
}{%
}%
}%

\LetLtxMacro\OldTopRule\toprule

\LetLtxMacro\OldMidRule\midrule

\newcolumntype{R}{>{\collectcell\FactorCell}r<{\endcollectcell}}

\begin{document}
\begin{tabular}{rrrr}
\toprule
& A     & B     & C \\
\midrule
1     & 33 122   & 133   & 156 \\
2     & 66 112   & 135   & 155 \\
3     & 77 150   & 139   & 158 \\
4     & 55 145   & 135   & 159 \\
5     & 44 150   & 130   & 200 \\
\bottomrule
\end{tabular}%
\hspace{2.0ex}
\begin{tabular}{rrRR}
\toprule
& A     & B     & C \\
\midrule
1     & 33 122   & 133   & 156 \\
2     & 66 112   & 135   & 155 \\
3     & 77 150   & 139   & 158 \\
4     & 55 145   & 135   & 159 \\
5     & 44 150   & 130   & 200 \\
\bottomrule
\end{tabular}%
\end{document}

-