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: expression formatting inside tables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54605] Re: [mg54591] expression formatting inside tables
  • From: "David Annetts" <davidannetts at aapt.net.au>
  • Date: Thu, 24 Feb 2005 03:21:09 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

 Hi Trevor,
> 
> hi mathgroup folks,
> let
> 
>   foo[x_] := x^2
> 
> then how to easily tableize the following?
> 
>   foo[1]   1
>   foo[2]   4
>   foo[3]   9
>   foo[4]   16
>   foo[5]   25
> 
> because neither
> 
>   Table[{HoldForm[foo[i]], foo[i]}, {i, 5}] // TableForm
> 
> nor
> 
>   Table[{foo[HoldForm[i]], foo[i]}, {i, 5}] // TableForm
> 
> did what i was expecting.

StringJoin["foo[", ToString[#], "]\t", ToString[foo[#]]]&  /@
Range[5]//TableForm

Works for me ....

Regards,

Dave.



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 22/02/2005


  • Prev by Date: Simplify and Abs
  • Next by Date: Re: problems plotting a derivative
  • Previous by thread: Re: expression formatting inside tables
  • Next by thread: Re: expression formatting inside tables