Formatting a long list in a table

How to show the result of a search as a table, for instance a 30 row per 10 columns table.

[Search db=bases.db&nefacturadata=0&facturasort=1
&facturatype=num&facturasdir=de&max00]
<table border="0" cellspacing="1" cellpadding="1" bgcolor="white">
<tr>
[founditems]
<td>[n_factura_rte]</td>
[showif [index]\10]
</tr><tr>
[/showif]
[/FoundItems]
[hideif [numfound]\10]</tr>[/hideif]
</table>
[/search]

Explanation: First, move the original <tr>...</tr> outside of the founditems loop. The founditems loop keeps track of which founditem you currently are focused on. The backslash operator in the showif comparison says "is divisible by", i.e., "is [index] divisible by 10?" If so, close out the current table row and begin a new one.

The last comparison makes sure that there is not an extraneous </tr> in the case when the number of items returned is also divisible by 10. Joe D'Andrea

DOWNLOAD WEBDNA NOW!

Top Articles:

AWS Raw WebDNA LAMP-Plus WebServer

Amazon Web Services (AWS) README for Machine Image ID...

WebDNA reference

A list of all WebDNA instructions...

WebDNA Modules

A list of the currently available modules...

Technical Change History

This Technical Change History provides a reverse chronological list of WebDNA changes...

WebDNA Libraries

A list of available libraries for WebDNA...

Tips and Tricks

A list of user-submitted tips ...

Related Readings:

random password-generator code

Generate a random alpha-numeric string...

How to keep the text variable after a function has finished

By default...

How to create a RSS feed

How to create a RSS feed from yourdatabase on formation...

Find duplicate records

Find duplicate records and do something with them...

Extracting the first sentence out of a block of text

I need to extract the first sentence out of a block of text...

Spaghetti code

How to get rid of very long search strings...