View Single Post
Old 05-07-2004, 04:43 PM   #2 (permalink)
organ_zola
Registered User
 
organ_zola's Avatar
 
Join Date: May 2004
Posts: 3
organ_zola is on a distinguished road
Hi,

After trawling the inernet, this was *nearly* the ideal solution for me!!

I have a 3 column table with 11 rows (currently) read from a MySQL database and returned as an array, butI need the last row of the table to display the last columns centered in the table.

I've tried hacking at the code on these lines:

***************************************
// add an extra <td></td> if there are not enough columns to complete the table
// only test if $i is on the last item of the array
if($i == ($count - 1))
{
// keep adding blank cells till it's at the end
while(($i + 1) % 3 != 0)
{
echo "<td>&nbsp;</td>\n";
$i++;
}
}
**************************************

but I've only succeded in frustrating myself after a couple of hours!!

What I've been trying to do is capture the last results which < 3 and place them in another table like so:
<td colspan="3" align="center">
<table>
<tr>
<td>odd number cell 1</td>
<td>odd number cell 2</td>
</tr>
</table>
</td>

Could somebody give some pointers please!!! I need to get some sleep tonight!!!

many thanks!
organ_zola is offline   Reply With Quote