head	1.6;
access;
symbols;
locks
	nobody:1.6; strict;
comment	@# @;


1.6
date	99.07.07.21.11.46;	author nobody;	state Exp;
branches;
next	1.5;

1.5
date	99.07.07.18.23.42;	author nobody;	state Exp;
branches;
next	1.4;

1.4
date	99.07.07.18.23.27;	author nobody;	state Exp;
branches;
next	1.3;

1.3
date	99.07.07.18.23.03;	author nobody;	state Exp;
branches;
next	1.2;

1.2
date	99.07.07.18.22.27;	author nobody;	state Exp;
branches;
next	1.1;

1.1
date	99.07.07.18.22.21;	author nobody;	state Exp;
branches;
next	;


desc
@null
@


1.6
log
@null
@
text
@IDependOn-Set: 1
IDependOn-Set: 122
IDependOn-Set: 244
IDependOn-Set: 245
IDependOn-Set: 246
IDependOn-Set: 247
LastModifiedSecs: 931371822
Parent: 244
SequenceNumber: 3
Title: Examples of creating a Html table...
Part: 0
Author-Set: jon@@working-dogs.com
HideAttributions: 1
LastModifiedSecs: 931371807
Type: monospaced
Lines: 42
----------
From: "PAUL J THOMPSON" <thomppj@@okstate.edu>
To: "Hardy, David" <dhardy@@xlvision.com>
Subject: Re: Table Rows and Data
Date: Tue, Jul 6, 1999, 8:01 AM


"Hardy, David" wrote:
> 
> By having to instantiate a new element for every new TD I can not
> dynamically create the table without assigning unique names to the TD.  In
> HTML all I would need to do is close the TD and start a new one.  It appears
> now that I have to have TR1 and TR2, therefore having to have some sort of
> incrementing systems for any new TR's I will have, since I can not have the
> same name or object reference.

Ok. I thinkI understand your question. The answer is that YES. You have
to create a different instance of TR for each row in a table. That is
just the way it works. If you want to do this dynamically, just stick it
in a for loop in something like follows:

/**** CODE SEGMENT ****?
int rows = 10;
int cols = 10;

Table bob = new Table;
for (int i = 0; i < rows; i++) {
  TR bobrow = new TR();
  for (int j = 0; j < cols; j++) {
    bobrow.addElement(new TD("Row " + i + ", Column " + j));
  }
  bob.addElement(bobrow);
}
/**** END CODE SEGMENT ****/

This litle segment of code creates a table with a dynamic number of rows
and columns (set by the variable rows and cols and with table cells
filled with a simple message. ("Row 1, Column 1", etc.)

I hope this helps a little.

Paul
EndPart: 0
Part: 1
Author-Set: jon@@working-dogs.com
HideAttributions: 1
LastModifiedSecs: 931371822
Type: monospaced
Lines: 38
----------
From: snagy <snagy@@norrellis.com>
To: ECS <ecs@@list.working-dogs.com>
Subject: Re: Table Rows and Data
Date: Tue, Jul 6, 1999, 7:52 AM


>Making any sense???

Yep, I think I understand now.  Here are a couple of examples dealing with
tables, do they address what you are wanting to do?

Table t = new Table();
for(x = 0 ; x < 10 ; x++)
{
    TR tr = new TR();
    for y = 0; y < 5; x++)
    {
        tr.addElement(new TD().addElement(y));
    }
    t.addElement(tr);
}

More practical example :

         while(rs.next())
            {
          table.addElement(new TR()
                    .addElement(new TD().addElement(new
A("./?desc="+rs.getString(7)+"&tab="+tab,rs.getString(1))))
                    .addElement(new TD().addElement(rs.getString(2)))
                    .addElement(new TD().addElement(rs.getString(3)))
                    .addElement(new TD().addElement(rs.getString(4)))
                    .addElement(new TD().addElement(rs.getString(5)))
                );
         }

-stephan
EndPart: 1
@


1.5
log
@null
@
text
@d6 1
@


1.4
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 931371807
d8 1
a8 1
SequenceNumber: 2
d59 45
@


1.3
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 931371782
d8 1
a8 1
SequenceNumber: 1
d10 49
@


1.2
log
@null
@
text
@d6 1
a6 1
LastModifiedSecs: 931371741
d8 2
a9 2
SequenceNumber: 0
Title: New Item
@


1.1
log
@null
@
text
@d4 1
@
