Re[2]: Using a section to display a table with X elements per line
| From: | Bertrand DUNOGIER | Date: | Mon, 04 Mar 2002 15:30:59 +0000 |
| Subject: | Re[2]: Using a section to display a table with X elements per line | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2938@lists.php.net to get a copy of this message | ||
MO> Does this help?
MO>
MO> http://www.phpinsider.com/php/code/Smarty/contribs/examples/dynamic_table_columns/table.tpl.txt
Hmmmm, it could have, but i see several weak points in it:
- if you come to have a number of elements which is a multiple of
#columns# you end up with two </tr>
- The remainings td are not added to the last line: with 6 elements
with #columns# == 4, we would probably get something like:
<tr>
<td>elem 1</td>
<td>elem 2</td>
<td>elem 3</td>
<td>elem 4</td>
</tr>
<tr>
<td>elem 5</td>
<td>elem 6</td>
</tr>
Even if it might work on some browser, it will probably crash with
most of them...
I think i'll build an array where each element is an array containing
a "line" of elements, including empty ones.
--
Bertrand mailto:bdunogier@wanadoo.fr
INTERACT
21, rue de Pont Remy
L-2423 Luxembourg mailto:bdunogier@wanadoo.fr