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
<table border="0" cellspacing="1" cellpadding="1" bgcolor="white">
[showif [index]\10]
[hideif [numfound]\10]</tr>[/hideif]

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


Top Articles:

AWS Raw WebDNA LAMP-Plus WebServer

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

WebDNA Libraries

A list of available libraries for WebDNA...


A compilation of some user's questions...

WebDNA Modules

A list of the currently available modules...

Download WebDNA Applications

WebDNA applications...

Technical Change History

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

Related Readings:

Setting a 30-minute Cookie

Configuring the expires time for a short-term cookie is tricky...

File upload example


Do you hate updating the copyright notice at the bottom of all your pages?

It's January 1st and you have to update the copyright notice at the bottom of all your websites...

Check the Federal Government's Social Security database

The script on the page will check the federal government's social security database...

WebDNA interaction with ImageMagick

How to pass variables to ImageMagick using a [shell] context?...

How to setup CODA to work with WebDNA?

This page will show graphically how to setup CODA as a WebDNA partner :-)...