On 03 Dec 2003 17:15:57 +1100, Pete Moran <[EMAIL PROTECTED]> wrote:

I know this is a really simple problem - and can be fixed using if
statements etc - but wanted to know if there was a standard way of doing
this.

Simply say I have a array

@array = qw/1 2 3 4 5 6 7 8 9 10/;

And I want to create a dynamic table of this data - BUT I want to have a
fixed column length (in this case 4).  The end table should look like

<table>
  <tr>
    <td>1</td>
    <td>2</td>
    <td>3</td>
    <td>4</td>
  </tr>
  <tr>
    <td>5</td>
    <td>6</td>
    <td>7</td>
    <td>8</td>
  </tr>
  <tr>
    <td>9</td>
    <td>10</td>
  </tr>
</table>

This can be done with $maxcol and $cnt, I have not tested but try this:



[- @array = qw/1 2 3 4 5 6 7 8 9 10/; $maxcol = 4; -] <table> <tr> <td>[+ $array[$cnt] +]</td> </tr> </table>

--
Luiz Fernando B. Ribeiro
Engenho Solu��es para a Internet

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to