Use rowspan without knowing how many rows?

M

Martin

Is there any way to combine table cells (using rowspan)in multiple
rows without knowing before hand how many rows will be involved?

I have a script that is adding rows to a table (stepping thru an SQL
query result set). The data in the first cell of each row may be
duplicated across 1 to 5 rows. But, when I generate the first row, I
don't know if the next row(s) are a duplicate or not.

Is there any way I can just "add on" or "expand" the rowspan for each
row as needed?

Thanks for any suggestions.
 
J

Jonathan N. Little

Martin said:
Is there any way to combine table cells (using rowspan)in multiple
rows without knowing before hand how many rows will be involved?

I have a script that is adding rows to a table (stepping thru an SQL
query result set). The data in the first cell of each row may be
duplicated across 1 to 5 rows. But, when I generate the first row, I
don't know if the next row(s) are a duplicate or not.

Is there any way I can just "add on" or "expand" the rowspan for each
row as needed?

Thanks for any suggestions.

Yes, count up your data BEFORE you generate the HTML! In other words
buffer it before you print|echo (whatever scripting language you are
using) the results or ...
 
H

Hywel Jenkins

Is there any way to combine table cells (using rowspan)in multiple
rows without knowing before hand how many rows will be involved?

I have a script that is adding rows to a table (stepping thru an SQL
query result set). The data in the first cell of each row may be
duplicated across 1 to 5 rows. But, when I generate the first row, I
don't know if the next row(s) are a duplicate or not.

Is there any way I can just "add on" or "expand" the rowspan for each
row as needed?

You must know how many rows are in your record set before you start
looping through them, surely? Seems like you've got multiple queries -
run them both before you start outputting the HTML.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top