Hello,
I am attempting to create a script that fills in cells dynamically based on an integer that populates a recordset. This integer is between 0 and 90. If the integer is 45 or less, the width of each row in a table is set to 5 cells. However, each interval of 9 after 45 (54, 63, 72, 81, 90) the number of cells per row is supposed to grow as well.

For instance, if the integer was 45, then the table would look like this (X stands for a cell w/ data inside it):

----------------
| 9 | X X X X X |
| 8 | X X X X X |
| 7 | X X X X X |
| 6 | X X X X X |
| 5 | X X X X X |
| 4 | X X X X X |
| 3 | X X X X X |
| 2 | X X X X X |
| 1 | X X X X X |
----------------

But if the integer was 46, the outcome should look like this:

----------------
| 9 | X X X X X |
| 8 | X X X X X |
| 7 | X X X X X |
| 6 | X X X X X |
| 5 | X X X X X |
| 4 | X X X X X |
| 3 | X X X X X |
| 2 | X X X X X |
| 1 | X X X X X X |
----------------

You see? When the number reaches past 45, it added a new column onto the table's row.

This leads to another instance where the integer reaches 57, for instance:

----------------
| 9 | X X X X X X |
| 8 | X X X X X X |
| 7 | X X X X X X |
| 6 | X X X X X X |
| 5 | X X X X X X |
| 4 | X X X X X X |
| 3 | X X X X X X X |
| 2 | X X X X X X X |
| 1 | X X X X X X X |
----------------

I just can't seem to get it to work! I've been off and on working at it for a few weeks now, and well... poop. Hopefully, somewhere out there, there's a guru that has the answers.