Re: table format question
- To: mathgroup at smc.vnet.net
- Subject: [mg51463] Re: [mg51433] table format question
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Sun, 17 Oct 2004 21:50:00 -0400 (EDT)
- Organization: Mathematics & Statistics, Univ. of Mass./Amherst
- References: <20041017155406.ZGJ15173.lakermmtao02.cox.net@smtp.east.cox.net>
- Reply-to: murray at math.umass.edu
- Sender: owner-wri-mathgroup at wolfram.com
Almost: I added a PaddedForm[#, 2]& /@ for the pcts column so its
entries, too, would be right-justified.
Thanks.
Bob Hanlon wrote:
> counts =
> {25, 10, 14, 10, 13, 12, 3, 6, 10, 8, 68};
> papers = Plus @@ counts;
> pcts = 100. counts/papers;
> grades =
> {"A ", "A-", "B+", "B ", "B-", "C+",
> "C ", "C-", "D+", "D ", "F "};
> TableForm[Transpose[{
> StyleForm[#, FontFamily -> "Courier"] & /@ grades,
> counts,
> PaddedForm[#, {3, 1}] & /@ pcts}],
> TableHeadings ->
> {None, {"Grade", "Number", "Per Cent"}},
> TableAlignments -> Right]
>
>
> Bob Hanlon
>
>
>>From: Murray Eisenberg <murray at math.umass.edu>
To: mathgroup at smc.vnet.net
>>Date: 2004/10/17 Sun AM 03:05:27 EDT
>>To: mathgroup at smc.vnet.net
>>Subject: [mg51463] [mg51433] table format question
>>
>>I have a table created by the following input:
>>
>>counts = {25, 10, 14, 10, 13, 12, 3, 6, 10, 8, 68};
>>papers = Plus @@ counts;
>>pcts = 100. counts/papers;
>>grades = {"A ","A-","B+","B ","B-","C+","C ","C-","D+","D ","F "};
>>TableForm[Transpose[
>> {grades, counts, NumberForm[#, {4, 1}] & /@ pcts}],
>> TableHeadings -> {None, {"Grade", "Number", "Per Cent"}}]
>>
>>1. How can I get a 0 to display after the decimal point in the last
>>column's first and last rows? (I tried to wrap the entire thing with an
>>obvious PaddedForm expression, but that had the unfortunate effect of
>>giving me decimals in the 2nd column, which should be integers without
>>any decimal point or trailing decimal places whatsoever.)
>>
>>2. How can I get the numbers in columns 2 and three to be
>>right-justified? (I tried TableAlignments but that didn't seem to do it.)
>>
>>
>>--
>>Murray Eisenberg murray at math.umass.edu
>>Mathematics & Statistics Dept.
>>Lederle Graduate Research Tower phone 413 549-1020 (H)
>>University of Massachusetts 413 545-2859 (W)
>>710 North Pleasant Street fax 413 545-1801
>>Amherst, MA 01003-9305
>>
>>
>
>
>
>
--
Murray Eisenberg murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305