Poniższy skrypt wczytuje mi dane z bazy i wyświetla na stronie w jednej kolumnie, czyli
1
2
3
4
5
6
Jak można go zmienić, aby wyświetlał to w ten sposób:
1 2
3 4
5 6
7 8
9 10
defined( '_VALID_MOS' ) or die( 'Accesso ristretto' ); global $_CONFIG, $database, $my; $params->def('moduleclass_sfx', ''); $params->def('img', '0'); $moduleclass_sfx =$params->get('moduleclass_sfx'); # determino Itemid della componente alberghi $query_id = "SELECT id FROM #__menu WHERE link='index.php?option=com_alberghi' AND published='1'"; $database->setQuery($query_id); $rows = $database->loadObjectList(); $Itemid=$rows[0]->id; $option="com_alberghi"; ?> <table cellspacing="0" cellpadding="0" width="100%" border="0"> <?php $query1="SELECT id, title FROM #__categories WHERE section = '".$option."' AND published = '1' AND access <= '".$my->gid."' ORDER BY name ASC"; $database->setQuery($query1); $rows = $database->loadObjectList(); foreach($rows as $row1) { // determino numero di strutture per ogni categoria $database->setQuery("SELECT count(id) FROM #__alberghi WHERE published = '1' AND catid = '".$row1->id."'"); $count = $database->loadResult(); ?> <tr align="left"> <td> <a href="<?php echo sefRelToAbs("index.php?option=".$option."&Itemid=".$Itemid."&task=viewcategory&catid=".$row1->id)?>"> <?php if($params->get('img')){ ?> <?php } ?> </a> </td> </tr> <?php } ?> </table>