marko_one
04-30-2003, 08:05 AM
Hi All,
I need to be able to build an html table (vb please). This table is composed of rowspans and
colspans which are not known intially until values are given from the database.
So for example, if I have data in a table which is for simplicity's sake CD collection.
This table can have columns:
Group Name (main item)
Group Members (children)
Tracks this year (grandchildren)
so if the group name is MyGroup, has 3 members, member 1 wrote 4 tracks, member 2 wrote 5
tracks and member 3 wrote 2 tracks.
The main item will have 3 children and 11 grandchildren. So the main item (Group Name) will
have a rowspan of 11, member 1 will have a rowspan of 4, member 2 will have a rowspan of 5 and
member 3 will have a rowspan of 2 in the HTML Table. The grandchildren will each be cells in
thier own right.
Obviously the rows in the database will not all be the same and so I need a way to be able to
create an HTML table for each row of the dataset.
so for my first row of the dataset, the table will be formed like this :
<table border="1" cellpadding="3" cellspacing="3">
<tr>
<td colSpan="" rowSpan="11">MyGroup</td>
<TD rowSpan="4">Member 1</TD>
<TD>member 1 track 1</TD>
</tr>
<TR>
<TD>member 1 track2</TD>
</TR>
<TR>
<TD>member 1 track 3</TD>
</TR>
<TR>
<TD>member 1 track 4</TD>
</TR>
<TR>
<TD rowSpan="5">Member 2</TD>
<TD>member 2 track 1</TD>
</TR>
<TR>
<TD>member 2 track 2</TD>
</TR>
<TR>
<TD>member 2 track 3</TD>
</TR>
<TR>
<TD>member 2 track 4</TD>
</TR>
<TR>
<TD>member 2 track 5</TD>
</TR>
<TR>
<TD rowSpan="2">Member 3</TD>
<TD>member 3 track 1</TD>
</TR>
<TR>
<TD>member 3 track 2</TD>
</TR>
</table>
can anybody help me out in developing a recursive function to create an html table given the numbers of children and grandchildren as these will be the rowspan values.
thanks in advance
Marko.
I need to be able to build an html table (vb please). This table is composed of rowspans and
colspans which are not known intially until values are given from the database.
So for example, if I have data in a table which is for simplicity's sake CD collection.
This table can have columns:
Group Name (main item)
Group Members (children)
Tracks this year (grandchildren)
so if the group name is MyGroup, has 3 members, member 1 wrote 4 tracks, member 2 wrote 5
tracks and member 3 wrote 2 tracks.
The main item will have 3 children and 11 grandchildren. So the main item (Group Name) will
have a rowspan of 11, member 1 will have a rowspan of 4, member 2 will have a rowspan of 5 and
member 3 will have a rowspan of 2 in the HTML Table. The grandchildren will each be cells in
thier own right.
Obviously the rows in the database will not all be the same and so I need a way to be able to
create an HTML table for each row of the dataset.
so for my first row of the dataset, the table will be formed like this :
<table border="1" cellpadding="3" cellspacing="3">
<tr>
<td colSpan="" rowSpan="11">MyGroup</td>
<TD rowSpan="4">Member 1</TD>
<TD>member 1 track 1</TD>
</tr>
<TR>
<TD>member 1 track2</TD>
</TR>
<TR>
<TD>member 1 track 3</TD>
</TR>
<TR>
<TD>member 1 track 4</TD>
</TR>
<TR>
<TD rowSpan="5">Member 2</TD>
<TD>member 2 track 1</TD>
</TR>
<TR>
<TD>member 2 track 2</TD>
</TR>
<TR>
<TD>member 2 track 3</TD>
</TR>
<TR>
<TD>member 2 track 4</TD>
</TR>
<TR>
<TD>member 2 track 5</TD>
</TR>
<TR>
<TD rowSpan="2">Member 3</TD>
<TD>member 3 track 1</TD>
</TR>
<TR>
<TD>member 3 track 2</TD>
</TR>
</table>
can anybody help me out in developing a recursive function to create an html table given the numbers of children and grandchildren as these will be the rowspan values.
thanks in advance
Marko.