Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Formating with TableForm

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57413] Re: Formating with TableForm
  • From: dh <dh at metrohm.ch>
  • Date: Fri, 27 May 2005 04:56:49 -0400 (EDT)
  • References: <d6us9e$j1c$1@smc.vnet.net> <d742sp$iqg$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Jeffry,

if you want to format every column differently, you can format every 
element separately. Here is an example:
Some data:
d = Table[Random[], {3}, {3}];
Here the "columns to be" must be in rows. Therefore, eventually Transpose.
We now format every row differently by e.g. row-1 2 digits, row-2 3 
digits ...
d = MapThread[#1 /@ #2 &, {{
       NumberForm[#, 2] &, NumberForm[#, 3] &, NumberForm[#, 4] &}, d}];
Now we transpose and print it:
TableForm[ Transpose[d] ]

Sincerely, Daniel

Jeffrey Pattavina wrote:

 >Thanks very much for the tip. I have the follow up question.
 >
 >Q;	If I must use NumberForm[TableForm[t], 3] as you suggest, then how
 >can I format data (columns) in a table differently. For example, one 
column
 >could be percents so you might want to use NumberForm[#,{10,2}]while 
another
 >column might be long numbers which you would want in scinetific form or
 >NumberForm[#,{10,0},DigitBlock->3].
 >
 >


  • Prev by Date: Re: Trouble with an integral
  • Next by Date: Re: How to get decent quality plots.
  • Previous by thread: Re: Formating with TableForm
  • Next by thread: FindFit with conditionals