f

#### Formatting a single line without effecting the entire table with the Text::Table module

Hi All,

I have a data structure (see script) that I need to printout. I almost have
what I
need but I cannot figure out how to format just one line (center it )
sample output is:
kreimer
EMMI CHRISTIAN       0      0         17
TRACEY LUSBY         0      4          0
TONA MCGEAN          0      7          0
Total:               0     11         17

What I would like is the word "kreimer" centered and the other names
remain left justified. What am I doing wrong?

Thanks

Lynn

----------script--------------
use strict;
use warnings;
use Text::Table;
use diagnostics;
use Data::Dumper;

my $people = { 'kreimer' => { 'TRACEY LUSBY' => [ 0, 4, 0 ], 'EMMI CHRISTIAN' => [ 0, 0, 17 ], 'TONA MCGEAN' => [ 0, 7, 0 ], }, 'OTHER' => { 'STEPHEN ESPESET' => [ undef, 4, 27 ], 'PATRICK HOONHOU' => [ 1, 3, 4 ], 'WOODROW WILSON' => [ undef, 2, 1 ], }, 'lusby' => { 'KEVIN FLUETSCH' => [ 0, 0, 22 ], 'DOUG BOSWORTH' => [ 0, 1, 6 ], 'DOUG PENICK' => [ 1, 2, 22 ], }, }; foreach my$tmp_people( values %{ $people->{'OTHER'} } ) { if ( !defined($tmp_people->[0] ) ) { $tmp_people->[0] = 0 } if ( !defined($tmp_people->[1] ) ) { $tmp_people->[1] = 0 } if ( !defined($tmp_people->[2] ) ) { $tmp_people->[2] = 0 } } my %manager_total = (); foreach my$managers( keys %{$people} ) { foreach my$person( keys %{ $people->{$managers} } ) {
$manager_total{$managers}[0] += $people->{$managers}->{$person}[0];$manager_total{$managers}[1] +=$people->{$managers}->{$person}[1];
$manager_total{$managers}[2] += $people->{$managers}->{$person}[2]; } } my$tb = Text::Table->new(

{
title       => 'Name',
align       => 'left',
align_title => 'center'
},

{
title       => 'Last Month',
align       => 'center',
align_title => 'center'
},

{
title       => 'YTD',
align       => 'center',
align_title => 'center'
},

{
title       => 'Rolling 12 months',
align       => 'center',
align_title => 'center'
},

);

#print Dumper (\%manager_total);

foreach my $managers( keys %{$people} ) {
$tb->add($managers);

foreach my $person( sort Mysort keys %{$people->{$managers} } ) {$tb->add( "$person", @{$people->{$managers}->{$person} } );

}
$tb->add( "Total: ", @{$manager_total{$managers} } );$tb->add();
}

print $tb; sub Mysort { my ( undef,$first ) = split ( / /, $a ); my ( undef,$last )  = split ( / /, $b );$first cmp $last; }   0 3/10/2005 6:18:56 PM comp.lang.perl.misc 33233 articles. 2 followers. brian (1246) is leader. 10 Replies 957 Views Similar Articles [PageSpeed] 25 Mothra <lynn.watts@ugs.com> wrote: > if ( !defined($tmp_people->[0] ) ) { $tmp_people->[0] = 0 } Excessive punctuation is bad for your (mental) health:$tmp_people->[0] = 0 unless defined $tmp_people->[0]; > if ( !defined($tmp_people->[1] ) ) { $tmp_people->[1] = 0 } > if ( !defined($tmp_people->[2] ) ) { $tmp_people->[2] = 0 } Gak! There are only 2 characters that are different between all three of those lines, that indicates that it can be written better. foreach ( 0 .. 2 ) {$tmp_people->[$_] = 0 unless defined$tmp_people->[$_]; } but that won't scale when you add a 4th tmp_people, so maybe: foreach ( 0 ..$#{ $tmp_people } ) {$tmp_people->[$_] = 0 unless defined$tmp_people->[$_]; } but since foreach uses an alias, we can make it even simpler by not doing the indexing ourselves, let perl do the indexing:$_ = defined() ? $_ : 0 for @$tmp_people;   # untested

or

for ( @$tmp_people ) {$_ = defined() ? $_ : 0; } or for ( @$tmp_people ) {     # this would be my choice of replacement code
$_ = 0 unless defined; } >$manager_total{$managers}[0] +=$people->{$managers}->{$person}[0];
>         $manager_total{$managers}[1] += $people->{$managers}->{$person}[1]; >$manager_total{$managers}[2] +=$people->{$managers}->{$person}[2];

When you see repeated patterns in code like that, it usually
means you can easily come up with a better design that doesn't
repeat so much.

--
Fort Worth, Texas

 0
3/10/2005 11:43:22 PM
* Mothra wrote:
>=20
> I have a data structure (see script) that I need to printout. I almost
> have what I need but I cannot figure out how to format just one line
> (center it ) sample output is:
>=20
> kreimer
> EMMI CHRISTIAN       0      0         17
> TRACEY LUSBY         0      4          0
> TONA MCGEAN          0      7          0
> Total:               0     11         17
>=20
> What I would like is the word "kreimer" centered and the other names
> remain left justified. What am I doing wrong?

After reading this module's documentation i'm thinking there's no way to=20
format a few lines differently than others. Consider to use another=20
format to indicate such "captions". Perhaps something like indentions:

kreimer
EMMI CHRISTIAN       0      0         17
TRACEY LUSBY         0      4          0
TONA MCGEAN          0      7          0
Total:               0     11         17

>=20
> ----------script--------------
>=20
> foreach my $tmp_people( values %{$people->{'OTHER'} } ) {
>     if ( !defined( $tmp_people->[0] ) ) {$tmp_people->[0] =3D 0 }
>     if ( !defined( $tmp_people->[1] ) ) {$tmp_people->[1] =3D 0 }
>     if ( !defined( $tmp_people->[2] ) ) {$tmp_people->[2] =3D 0 }
> }

Since youre values are always numbers, this loop can be reduced to:

for ( values %{$people->{OTHER}} ) {$_ ||=3D 0 for @$_; } For testing for definedness, I've heard about an =BB//=3D=AB operator that= =20 will be introduced in Perl6, but here this should be sufficient. >=20 > my %manager_total =3D (); > foreach my$managers( keys %{$people} ) { > foreach my$person( keys %{ $people->{$managers} } ) {
>         $manager_total{$managers}[0] +=3D $people->{$managers}->{$person}= [0]; >$manager_total{$managers}[1] +=3D$people->{$managers}->{$person}=
[1];
>         $manager_total{$managers}[2] +=3D $people->{$managers}->{$person}= [2]; > } > } For me, your style isn't as good as it could be. Try out: my %manager_total =3D (); for my$m ( keys %{$people} ) { for my$p ( values %{$people->{$m}} ) {
for my $i ( 0 ..$#{$p} ) {$manager_total{ $m }[$i ] +=3D $p->[$i];
}
}
}

[...]

>=20
> foreach my $managers( keys %{$people} ) {
>     $tb->add($managers);
>=20
>     foreach my $person( sort Mysort keys %{$people->{$managers} } ) { >=20 >$tb->add( "$person", @{$people->{$managers}->{$person} } );
^^^

Adding here two blanks will indenting these lines (see above).

>=20
>=20
>     }
>     $tb->add( "Total: ", @{$manager_total{$managers} } ); >$tb->add();

On my system, adding *nothing* will produce the warning "Use of=20
uninitialized value in range (or flop) at Text/Table.pm line 380".=20
Perhaps you want to add a blank to generate a blank line

$tb->add( " " ); > } >=20 > print$tb;
>=20
> sub Mysort {
>=20
>     my ( undef, $first ) =3D split ( / /,$a );
>     my ( undef, $last ) =3D split ( / /,$b );
>     $first cmp$last;
>=20
> }

I'd write this as

sub Mysort {
(split / /, $a)[1] cmp (split / /,$b)[1]
}

but I don't think every proposal above results in better readability.=20
This might depending on one's individual flair.

regards,
fabian

 0
Fabian
3/11/2005 2:43:09 AM
Mothra <lynn.watts@ugs.com> wrote in comp.lang.perl.misc:
> Hi All,
>
> I have a data structure (see script) that I need to printout. I almost have
> what I
> need but I cannot figure out how to format just one line (center it )
> sample output is:
> kreimer
> EMMI CHRISTIAN       0      0         17
> TRACEY LUSBY         0      4          0
> TONA MCGEAN          0      7          0
> Total:               0     11         17
>
> What I would like is the word "kreimer" centered and the other names
> remain left justified. What am I doing wrong?

[code appreciated, but snipped]

Text::Table currently only supports one alignment specification for
each column, so there is no way you can require central alignment for
some lines and not for others.  You are not the first one who wants
to do that, so a future revision may support it, but that's not coming
soon.

For the moment, if you can do with a fixed amount of indentation instead
of true center alignment, just prefix the (manager-) names with a number
of blanks when you add them (see below).

foreach my $managers( keys %{$people} ) {
$tb->add( "$managers");

Oh, and to add a blank line to the table, add a single empty string,
not an empty list:

tb->add( ''); If you must have center alignment, you can probably use the ->colrange method to print the centered names manually. That should be doable, though I'm not quite sure how I would do it. Ask again if you need it. Anno   0 anno4000 3/11/2005 10:42:19 AM Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de> wrote in comp.lang.perl.misc: [Text::Table] > On my system, adding *nothing* will produce the warning "Use of > uninitialized value in range (or flop) at Text/Table.pm line 380". Oh... that's a bug. The next release will silently ignore empty lines. I can't believe I don't have a test for this. Thanks for the input. > Perhaps you want to add a blank to generate a blank line > >tb->add( " " );
>
> > }

An empty string will do.  Even "undef" is accepted (though not recommended)
for the purpose.

Anno (author of Text::Table)

 0
anno4000
3/11/2005 10:47:47 AM
Hi Tad,

> Lynn <lynn.watts@ugs.com> wrote:
>
(snipped)
>
> Gak! There are only 2 characters that are different between all
> three of those lines, that indicates that it can be written better.
>
(more snippage)
> but since foreach uses an alias, we can make it even simpler
> by not doing the indexing ourselves, let perl do the indexing:
>
>    $_ = defined() ?$_ : 0 for @$tmp_people; # untested > > or > > for ( @$tmp_people ) {
>       $_ = defined() ?$_ : 0;
>    }
(even more snippage)
> When you see repeated patterns in code like that, it usually
> means you can easily come up with a better design that doesn't
> repeat so much.
Thanks for your reply, That is great!! I like what you did to the code :-)
BTY, Where is the ? and : documented in perldoc?  I can't find them
(this is the reason I use diagnostics in my programs, it tells me what
to type into perldoc)
I tried:
perldoc -f :
No documentation for perl function :' found
perldoc -f ?
No documentation for perl function ?' found
perldoc ?
No documentation found for "?".
perldoc :
No documentation found for ":".

Thanks

Lynn


 0
lynn
3/11/2005 1:47:35 PM
"lynn" <lynn.watts@ugs.com> wrote in message
news:4231a0a4$1@usenet.ugs.com... > BTY, Where is the ? and : documented in perldoc? I can't find them > (this is the reason I use diagnostics in my programs, it tells me what > to type into perldoc) > I tried: > perldoc -f : > No documentation for perl function :' found > perldoc -f ? > No documentation for perl function ?' found perldoc -f is for function names. Neither ? nor : are functions > perldoc ? > No documentation found for "?". > perldoc : > No documentation found for ":". perldoc <topic> for both the predefined documentation that comes with perl (see perldoc perltoc for a full list) as well as modules. ? and : are neither. Indeed, in the code your referenced, ? and : are not separate entities, but are instead a single operator, ?: This operator, like all operators, is documented in perldoc perlop. It is referred to therein as the "conditional operator", but you may also hear the term "trinary operator" (simply because it takes three arguments. Hope this helps, Paul Lalli   0 Paul 3/11/2005 1:53:04 PM Hi Fabian, "Fabian Pilkowski" <pilkowsk@informatik.uni-marburg.de> wrote in message news:MPG.1c9b241ae80c92069898cb@news.individual.de... (snipped) > After reading this module's documentation i'm thinking there's no way to > format a few lines differently than others. Consider to use another > format to indicate such "captions". Perhaps something like indentions: After reading the other replys this is what I will do > > ----------script-------------- > (snipped) > Since youre values are always numbers, this loop can be reduced to: > for ( values %{$people->{OTHER}} ) {
>       $_ ||= 0 for @$_;
>  }
That looks good :-)

> For testing for definedness, I've heard about an �//=� operator that
> will be introduced in Perl6, but here this should be sufficient.
>
(more snippage)

> For me, your style isn't as good as it could be. Try out:

>    my %manager_total = ();
>    for my $m ( keys %{$people} ) {
>        for my $p ( values %{$people->{$m}} ) { > for my$i ( 0 .. $#{$p} ) {
>                $manager_total{$m }[ $i ] +=$p->[$i]; > } > } > } Much better :-) > > foreach my$managers( keys %{$people} ) { >$tb->add($managers); > > foreach my$person( sort Mysort keys %{ $people->{$managers} } ) {
>
>         $tb->add( "$person", @{ $people->{$managers}->{$person} } ); ^^^ >>$tb->add();

> On my system, adding *nothing* will produce the warning "Use of
> uninitialized value in range (or flop) at Text/Table.pm line 380".
> Perhaps you want to add a blank to generate a blank line

I did not get any warnings, I am running perl 5.8.3 on windows.
(I did use warnings!! )
>
> print $tb; > > sub Mysort { > > my ( undef,$first ) = split ( / /, $a ); > my ( undef,$last )  = split ( / /, $b ); >$first cmp $last; > > } > I'd write this as > sub Mysort { > (split / /,$a)[1] cmp (split / /, $b)[1] > } Looks good, Thanks for your response :-) Lynn   0 lynn 3/11/2005 1:56:25 PM Hi Anno "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message news:d0rsmb$na61@mamenchi.zrz.TU-Berlin.DE... (snipped) > > [code appreciated, but snipped] > > Text::Table currently only supports one alignment specification for > each column, so there is no way you can require central alignment for > some lines and not for others. You are not the first one who wants > to do that, so a future revision may support it, but that's not coming > soon. First off I would like to say I really like your module :-) It makes creating reports much easier. > > For the moment, if you can do with a fixed amount of indentation instead > of true center alignment, just prefix the (manager-) names with a number > of blanks when you add them (see below). > > foreach mymanagers( keys %{$people} ) { >$tb->add( "   $managers"); This is what I have decided to do, Thanks!! > > Oh, and to add a blank line to the table, add a single empty string, > not an empty list: > >$tb->add( '');
>
Yes, I saw the reply from Fabian however, I did not receive the warnings
he was refering to (odd). Thanks for all of your help!!

Lynn


 0
lynn
3/11/2005 2:18:42 PM
Hi Paul,

"Paul Lalli" <mritty@gmail.com> wrote in message
news:4phYd.96063$g16.95797@trndny08... > "lynn" <lynn.watts@ugs.com> wrote in message > news:4231a0a4$1@usenet.ugs.com...
(snipped)
>
> perldoc <topic> for both the predefined documentation that comes with
> perl (see perldoc perltoc for a full list) as well as modules.  ? and :
> are neither.

Great ! now I can see the full list :-)

>
> Indeed, in the code your referenced, ? and : are not separate entities,
> but are instead a single operator, ?:
>
> This operator, like all operators, is documented in perldoc perlop.  It
> is referred to therein as the "conditional operator", but you may also
> hear the term "trinary operator" (simply because it takes three
> arguments.
>
> Hope this helps,
Yes!! indeed this does help. Perl is a great programming language
however, finding things in the documentation has caused me so much
grief. I don't blame the doc though more on my ability to use them (perldoc)

Once again, Thanks for all of your help :-)

Lynn


 0
lynn
3/11/2005 2:25:02 PM
lynn <lynn.watts@ugs.com> wrote in comp.lang.perl.misc:

[Text::Table]

> Yes, I saw the reply from Fabian however, I did not receive the warnings
> he was refering to (odd). Thanks for all of your help!!

The bug is only in 1.107.  You probably have an earlier version.

Anno

 0
anno4000
3/11/2005 3:56:29 PM

Similar Artilces:

Re: TABLES TABLES TABLES
sasbum@AOL.COM wrote: >How would you best describe to a retiscent SAS student that the concept of >TABLES isn't limited to SQL? This came up during a discussion on table >lookup methods - and lookup tables in particular (I mean, lookup tables >pre- >date SQL). Even SAS data sets are referred to as tables. This made the >student apoplectic. I find a visual works well here. If you show a grid with rows and columns, then you can show a picture of a SAS data set and a SQL table and a lookup table, and show that (regardless of terminology and buzzwords) they're all pretty much the same. >Words of wisdom most welcome!!! Sorry, all you get is me. David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330 _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ ...

DAO recordset append single record locks entire table (linked table)
I'm having problem with using DAO recordset to append record into a table and subsequent code to update other tables in a transaction. The MDB is Access 2000 with the latest service pack of JET 4. The system is client/server, multiusers based. The MDBs are using record locking. Here is part of the code: Dim wkSpace As Workspace, db As Database Dim rstTrans As DAO.Recordset Set wkSpace = DBEngine.Workspaces(0) Set db = CurrentDb() wkSpace.BeginTrans 'some code... Set rstTrans = db.OpenRecordset("tblTrans", dbOpenDynaset, dbAppendOnly, dbOptimistic) With rstTrans .AddNew 'set field values... .Update .Close End With 'codes updating other tables wkSpace.CommitTrans The process is fine if the tables are local tables. But if the tables are linked tables, it locks the entire tblTrans table once it execute the Update method. No other user can update or append the tblTrans table at all (with "Could not update; currently locked." error) I'm sure that nothing else lock the table as I did run the code (just the recordset append code) in the frontend and backend. It seems the lock apply properly only to local tables? I imagine that the lock would be due to the transaction. See if it makes any difference if you omit the line: wkSpace.BeginTrans -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.ht...

Re: TABLES TABLES TABLES #6
Ahhhh - I'm lovin' that one. TY TY In a message dated 12/1/2005 6:14:05 AM Eastern Standard Time, rdevenezia@WILDBLUE.NET writes: Friar Broccoli wrote: > Try this (a higher authority): > > http://www.google.com/search?num=100&hl=en&lr=lang_en&safe=off&as_qdr=all&q=de fine%3A+data+table&btnG=Search&lr=lang_en > > Howard Wood wrote: >> OHHH went there, did that, got the t-shirt, even. I tried >> everything in the book. This person is extremely LITERAL and >> looking for the letter of the law, or something........maybe...

Re: TABLES TABLES TABLES #2
OHHH went there, did that, got the t-shirt, even. I tried everything in the book. This person is extremely LITERAL and looking for the letter of the law, or something........maybe my trying so hard just egged him on, or his stubbornness that kept his feet in concrete, but I don't think so. He truly believes that. -----Original Message----- From: David L Cassell <davidlcassell@MSN.COM> To: SAS-L@LISTSERV.UGA.EDU Sent: Sun, 27 Nov 2005 11:55:12 -0800 Subject: Re: TABLES TABLES TABLES sasbum@AOL.COM wrote: >How would you best describe to a retiscent SAS student that the concept...

Re: TABLES TABLES TABLES #3
You might say he is "incorrigible". Rob Rohrbough Omaha, NE > -----Original Message----- > From: Howard Wood [mailto:sasbum@AOL.COM] > Sent: Monday, November 28, 2005 10:25 AM > Subject: Re: TABLES TABLES TABLES > > > LOL -- I told him I had a table in my dining room, and > another kind in my kitchen, etc. > > -----Original Message----- > From: Ed Heaton <EdHeaton@westat.com> > To: Howard Wood <sasbum@AOL.COM> > Sent: Mon, 28 Nov 2005 08:44:38 -0500 > Subject: RE: TABLES TABLES TABLES > > > Howard, > > Maybe you should turn the tables on him and correct him whenever he > refers to a sedan as a car or to beef as meat or to an engine as a > motor. > > Ed > > Ed Heaton > RW-4541 > #4818 > > > > -----Original Message----- > From: owner-sas-l@listserv.uga.edu > [mailto:owner-sas-l@listserv.uga.edu] > On Behalf Of Howard Wood > Sent: Saturday, November 26, 2005 7:59 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: TABLES TABLES TABLES > > > How would you best describe to a retiscent SAS student that > the concept > of TABLES isn't limited to SQL? This came up during a discussion on > table lookup methods - and lookup tables in particular (I mean, lookup > tables pre- date SQL). Even SAS data sets are referred to as tables. > This made the student apoplectic. > > Words of wisdom most welcome!!! > > Thanks, > Ho...

Table without lines
Hi: I would like to have a table(s) with no lines between the cells. Is this possible -- if so, how? All suggestions gratefully received. Hugh -- Hugh Newbury Running Linux Suse 10.1 in deepest Dorset Thu, 12 Jun 2008 17:15:45 +0100, /Hugh Newbury/: > I would like to have a table(s) with no lines between the cells. Is this > possible -- if so, how? http://www.w3.org/TR/html401/struct/tables.html#borders -- Stanimir Stanimir Stamenkov wrote: > Thu, 12 Jun 2008 17:15:45 +0100, /Hugh Newbury/: > >> I would like to have a table(s) with no ...

Nested table alters format of host table.
Hi, I need to have a table nested within another table. The tables are alongside each other visually speaking, and the nested table (on the right) can vary in size. My problem is that when the nested table has more rows than the first table, the first table (on the left) pads out its rows so that the table matches the height of the nested table. I don't want this it happen.. I just want the nested table to be longer than the first table. Anybody have any ideas?? Gaz. Here's a quick example of the problem : <!doctype html public "-//W3C//DTD HTML 4.0 Trans...

How to combine two unrelated tables into a single table
Dear all How to merge two unrelated tables into a single table? They have same id number for relationship. But,I can't use the join function with id numbers. It is because some data can't be extracted from the database by using id numbers as a condition. I am use Sybase server. The table is written in view My situation is: Table A studentid firstname lastname age Table B studentid course_name school_address school_campus school_phone Wanted result table customerid firstname lastname age course_name school_address school_campus school_phone <-- they are column headers(in the same row) how can I write the SQL query? what functions I should use? Thanks I'm not sure what you mean when you say "I can't use the join function with id numbers. It is because some data can't be extracted from the database by using id numbers as a condition." Without joining the two tables, how would you go about combining them? (hint: you can't). Perhaps the student_id is actually the SSN or similar that can't be published in a report? If so, you can still use the join to get your data, just don't include it in the results table. I see that you've already used a new column "customerid" - if this is established as an identity column you shouldn't have a problem. create table result_table ( customerid numeric(8,0) identity, firstname varch...

Multiple tables or single table in one tablespace ?
Hi , all We have hundreds of tables in on tablespace , but I'm planning to change as one table per one tablespace. . I wonder how other shops does ? Are there any special reasons in UDB keeping multiple tables in one tablesapce ? Regards Myoungsoo Ex M/F DBA Hi! We group tables in tablespace by logical groups. For example, all common tables (like currency, country, ...) are in one tablespace. If we have large tables that need to be fast we usually use range partitioning across multiple tablespaces. Best regards, Kovi mvsmsh pravi: > Hi , all > We have hundreds of tables in on tablespace , > but I'm planning to change as one table per one tablespace. . > > I wonder how other shops does ? > > Are there any special reasons in UDB > keeping multiple tables in one tablesapce ? > > > Regards > Myoungsoo > > Ex M/F DBA -- ____________________________ |http://kovica.blogspot.com| -----------------------------~-~-~-~-~-~-~-~-~-~- | In A World Without Fences Who Needs Gates? | | Experience Linux. | -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- mvsmsh wrote: > Hi , all > We have hundreds of tables in on tablespace , > but I'm planning to change as one table per one tablespace. . > > I wonder how other shops does ? > > Are there any special reasons in UDB > keeping multiple tables in one tablesapce ? With automa...

siunitx table-format and table-column-width
Hello, \documentclass{article} \usepackage [T1]{fontenc} \usepackage {siunitx}% loads array.sty \begin{document}\makeatletter \begin{tabular}{ | S [table-format=8.2] | S[table-format=6.2,table-column-width=22mm] | } 3254346.324 & 325436.3255 \\ 3254346.324 & 325436.3255 \\ \end{tabular} \end{document}\endinput Questions: 1) Is this on purpose that table-format=8.2 does not round or truncate the number to 2 decimals ? well it seems to be "table-auto-round" 2) Though I understand and see a difference when i set table-column-width to some judicious value, the example 41 in the doc does not show any noticeable difference between "Fixed" and "Flexible"... ;-( Regards. ...

siunitx : table-format and table-auto-round
Hello, two points on which i might be wrong, or not : 1/ table-format could set table-auto-round=true since the format is the output format: 3.2 means we want 2 decimals doesn't it ? 2/ table-align-exponent does not work with table-number-alignment=center-decimal-marker. So it may set table-number-alignment=center in this case... (I still can't figure out the purpose of 'center-decimal-marker'...) Best regards. \documentclass [a4paper]{article} \usepackage [utf8]{inputenc} \usepackage [T1]{fontenc} \usepackage {etex} \usepackage {...

Front end text formatting
Hi, I'm totally new to formatting in Mathematica. Please could someone help me make it so my default.nb does fractions that don't shrink in font size? Also, my table font is set to courier and the equations don't do italics as usual. How do I solve this? Many thanks well look hard for options - there are many that may help. here's a clue if you can't find any... on my box Mathematica doubles the Box height when I enter a faction and the fraction is the same size. try changing style sheets? Mine does that for Style Input but not Style Text. For style text the thing does get a double box size but still appears smaller StyleBox[FractionBox[x, y], FontSize -> 18] // DisplayForm shows it larger. there are a few ways you can wrap stylebox around every FractionBox whenever FractionBox is input or whenever it's output. see InputAutoReplacements for one way. Another way is to make FractionBox function yourself (call the orig. one but wrap it). Again there may be a Global Option for BoxData or RowBox I can't find that, using Style Text, chooses a bigger font. HOWEVER. If I change from Text style to Input it is changed: my 1/2 is fully double sized again automatically. ** I'd say pop open the Style Sheet and see where the difference is there ** sorry if that didn't help ...

How can I enter several lines of text as a criterion and return several lines from my table?
Right now at work, I get forms e-mailed to me in an Excel chart with a serial number in one column and a new expiration date for a device's trial period in another column. For a while, when people only sent forms with one or two lines, I didn't mind making a simple parameter query that searched for a serial number (ESN) and showed me the relevant line of my office's tracking database so I could change the date, etc. Here's how it looks: http://klg.cps.com/temp/googlegroups/accesscurrent1.gif http://klg.cps.com/temp/googlegroups/accesscurrent2.gif However, when I get 6-20 requests on the same form, it would be really nice to just hilight the serial number column from the Excel form I received... http://klg.cps.com/temp/googlegroups/extensionrequest.gif ....paste it into a form or something in Access, and have a query pop up that shows the relevant lines of my database for all of those serial numbers. I have searched every keyword on Google Groups and Google that I can think of. I've looked in reference manuals. I'm just plain stuck and can't figure out how to do this. If I'm asking in the wrong place, please redirect me. Thank you. -KitKat KitKat wrote: > Right now at work, I get forms e-mailed to me in an Excel chart with a > serial number in one column and a new expiration date for a device's > trial period in another column. > > For a while, when people only sent forms with one or two lines, I > didn't m...

Formatting tables without javascript
hi, im trying to create collapsible tables without using a javascript method to format the table, this is because i need it to work inside an email (the java versions don't work), I was wondering if there was a way to update the formatting of a table using a hyperlink, I suck at CSS and im not sure if this is possible just using style sheets using the a:clickme:active style to hide a table , or its a requirement to use a script to do the change over ? ...

Tables Without OIDS and its effect
Dear all , I have created my tables without OIDS now my doubts are : 1. Will this speed up the data insertion process 2. Though I have not written any code in my any of the pgsql functions which depend on OIDS 1. Will without OIDS the functions behave internally differently 2. Will my application break at any point 3. I decided to work with out OIDS because 1. It has a limit of -2147483648 to +2147483647 2 Due to this limitation I would not like to drop recreate my database because it is a bit difficult/dirty process All links and suggestion pertaining to OIDS are most welc...

Formatting text in a table with reportlab
I sent off a msg to the reportlab list but didn't find an answer, hoping so= meone here might have come across this... I am generating a table to hold text oriented by the specification of the l= abel it gets printed on. I need to compress the vertical size of the table a lit= tle more but the larger text in (1, 0) and (1, 1) as compared to the rest cause= s it to migrate downwards away from the upper boundary of the cell that it's in. Is there a better way to accomplish this or some way I can prevent the behavior? I have tried adjusting with the rowHeight in Table() but...

in table a but not in table b
Hallo, I have two tables, a and b. For the sake of clarity I use only one column in both tables. a. has a columns containing values NL,DE,FR, IT b has a column containing values NL and FR I need a query that selects the missing value(s), and only the missing values in table b. So the result should be DE and IT. I'm sure some join would work, but I am totally confused by them joins... ;-)) Please give me clue sjef escribi�: > Hallo, > I have two tables, a and b. For the sake of clarity I use only one > column in both tables. > a. has a columns containing values NL,DE,FR, IT >...

Text formatting inside tables
Hi, I have a table in which some lines in rows are too long. To break them into multiple lines, I am using the tabularx package. But its making those lines justified on both sides. Is it possible to get those table cells as left justified? Thanks, -M try \begin{tabular}{|>{\raggedright}p{5cm}<{}|>{\raggedright}p{5cm}<{}|} .... ploplpo... \end{tabular} for a two column table and replace all your \\ (to go to the next line) by \tabularnewline Pluton pluton wrote: > try > > \begin{tabular}{|>{\raggedright}p{5cm}<{}|>{\raggedright}p{5cm}<{}|} > > ... ploplpo... > > \end{tabular} > > for a two column table and replace all your \\ (to go to the next line) > by \tabularnewline > > Pluton > or use >{\raggedright\arraybackslash} in the last column -- /daleif (remove RTFSIGNATURE from email address) LaTeX FAQ: http://www.tex.ac.uk/faq Superb Class: http://www.ctan.org/tex-archive/help/Catalogue/entries/memoir.html LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish) Remember to post minimal working examples. ...

tables: changing default table font for all tables in a document
Hello, I would like all tables in a document to appear in a font different from the one that I use for the rest of the document. One way to do this is to wrap \textsf{...} around every table: \textsf{ \begin{tabular}{rcc} [...] \end{tabular} } does the trick. But isn't there a way to redefine the tabular environment so that I need not employ \textsf{...}for each table? Thank you, --John John Bullock wrote: > Hello, > > I would like all tables in a document to appear in a font different > from the one that I use for the rest of the document. One way to do this is > to wrap \textsf{...} around every table: > > \textsf{ > \begin{tabular}{rcc} > [...] > \end{tabular} > } > > does the trick. But isn't there a way to redefine the tabular environment so > that I need not employ \textsf{...}for each table? > > Thank you, > --John > > > does your tables float? because then redefining the table environment might be enough something like (untested) \let\oldtable\table \renewcommand\table[1][]{\oldtable[#1]\sffamily} -- /daleif (remove RTFSIGNATURE from email address) LaTeX FAQ: http://www.tex.ac.uk/faq LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish) Remember to post minimal examples, see URL below h...

Tables Without OIDS and its effect
Dear all , I have created my tables without OIDS now my doubts are : 1. Will this speed up the data insertion process 2. Though I have not written any code in my any of the pgsql functions which depend on OIDS 1. Will without OIDS the functions behave internally differently 2. Will my application break at any point 3. I decided to work with out OIDS because 1. It has a limit of -2147483648 to +2147483647 2 Due to this limitation I would not like to drop recreate my database because it is a bit difficult/dirty process All links and suggestion pertaining to OIDS are most welc...

table class for table
Hi: Is there free code for a "Table" class? I am especially interested in using this class to store "table information" extracted from html. Thanks, John I'd be inclined to use something like String[][] for the general case. -- ROGER NEYMAN <homecurr@yahoo.com> wrote in message news:2d5d0ce4.0405161110.36f9b7ca@posting.google.com... > Hi: > > Is there free code for a "Table" class? I am especially interested in > using this class to store "table information" extracted from html. > > Thanks, > > John Good ne...

select table.* from table
I'm using JDBC to update Oracle 9i tables. If I execute "select * from table" then, even though I've requested an updatable resultset, I cannot modify the resultset -- it fails with "Invalid operation for read only resultset". If, however, I change the query to "select table.* from table" then I *can* modify the resultset. What is the distinction between these queries that makes one read-only and one writable? Thanks. ...

Formatting a table in text-output
Hi folks, I have a to display a number of tables but not in html, that would be not a big problem, no I need the tables in text-output. I know, that the most of cell-data can displayd in one row, but some cells will have linebreaks. Maybe someone know a stylesheet doing this formatting work. As example my xml: <table> <col1>hallo</col1> <col2>world</col2> <col3>nice to meet you, hope you are fine</col3> </table> Has to be formatted in this way : MyCol1 MyCol2 MyCol3 hallo world nice to meet you, hope you are fine Any ideas ? Thanks a lot for help. lemmchen said the following on 10/11/2005 13:45 +0200: > I have a to display a number of tables but not in html, that would be > not a big problem, no I need the tables in text-output. I know, that > the most of cell-data can displayd in one row, but some cells will have > linebreaks. I don't know a solution to the last sentence, maybe some regular of this list has a solution. > Any ideas ? Thanks a lot for help. I'm currently trying to do the same thing (ASCII tables) and found this: http://www.biglist.com/lists/xsl-list/archives/200110/msg00110.html I'm playing with that now .. -- Regards Harrie Yes, this is interesting, this stylesheet doesnt look bad. But when you modify data and make values longer, then data is cut to fit it in column. The next step is to make linebreaks in one col...

Append 2nd, 4th, 6th line of a text file to the 1st, 3rd, 5th line as a table
Hi, Let me explain. I have been given a file that I need to bring into an Access table. Here is a snippet of the file. 100833983 1 MRS M I BATTY 1 000001 00833983 1 MR G S G SINGH SABHA 1 000002 01280570 1 MR M ANWAR 1 000003 01360043 1 MR C PAPARESTI and so on. At the end of each line is a hard return, therefore if I import this into Access each row in the text file becomes a record. All I need is the payee and the claim no in a format as shown below: MRS M I BATTY 00833983 MR G S G SINGH SABHA 01280570 MR M ANWAR 01360043 MR C PAPARESTI 01664018 How can I get the second line added to the end of the first, and the fourth added to the end of the third and so on. Any help would be massively appreciated. Cheers. carl.barrett@newcastle.gov.uk wrote: > Hi, > > Let me explain. I have been given a file that I need to bring into an > Access table. > > Here is a snippet of the file. > > 100833983 > 1 MRS M I BATTY > 1 000001 00833983 > 1 MR G S G SINGH SABHA > 1 000002 01280570 > 1 MR M ANWAR > 1 000003 01360043 > 1 MR C PAPARESTI > > > and so on. > > At the end of each line is a hard return, therefore if I import this > into Access each row in the text file becomes a record. > > All I need is the payee and the claim no in a format as shown below: > ...

Web resources about - Formatting a single line without effecting the entire table with the Text::Table module - comp.lang.perl.misc

Resources last updated: 3/22/2016 10:41:36 AM