Jump to content

trying to display output in to columns


farkewie

Recommended Posts

Hi i am trying to display comtent in 2 columns but it keeps staying in 1 basiclyi want it to look like below

 

item1    item2

item3    item4

item5    item6

 

Here is the piece of code im trying to edit.

 


<?php

if($config['content_top']) 
{
$mService = new MenuService(); 
    echo $GLOBALS['MENU']->getContent();
unset($meService);
}

//    echo '<div id="preview">';

$ir = new ItemRequest($itemtype);
$ir->setID($GLOBALS['MENU']->getID());
$ir->setLanguageID($GLOBALS['MENU']->getLanguageID());
$ir->setItemType(_BIGACE_ITEM_MENU);
if($config['show_hidden'])	{
	$ir->setFlagToExclude($ir->FLAG_ALL_EXCEPT_TRASH);
}
$ir->setOrderBy($params['orderby']);
$ir->setOrder($params['order']);

$menus = new SimpleItemTreeWalker($ir);
    
$ct = $menus->count();
$half = ($ct / 2 );
$round = floor($half);
$in = 0;
print "<table>";
print $round;
    for ($i=0; $i < $menus->count(); $i++) 
    {
	print "<tr>";
        $temp_menu = $menus->next();
        $url = LinkHelper::getUrlFromCMSLink( LinkHelper::getCMSLinkFromItem($temp_menu) );
       // echo '<div class="nextLevelPreview">';
        echo '<h3><a href="'.$url.'" title="'.$temp_menu->getName().'">';
        echo $temp_menu->getName();
        echo '</a></h3><p>';
         
        if( strlen(trim($temp_menu->getDescription())) > 0 )
        	echo $temp_menu->getDescription();
        else
        	echo getTranslation('empty_description');
        	
        echo ' <a href="'.$url.'" title="'.getTranslation('list_link_title').$temp_menu->getName().'"><img border="0" src="'.$GLOBALS['_BIGACE']['DIR']['public'].'modul/images/3arrows.gif" alt="'.getTranslation('list_img_alt').'"></a>';
        //echo '</p></div>';
print "</tr>";
$in++;
if ($in == $round ) {
print "<td></td>";
}
    }
    print "</table>";

//	echo '</div>';

// display content below submenus?!?
if($config['content_bottom']) 
{
$mService = new MenuService(); 
    echo $GLOBALS['MENU']->getContent();
unset($meService);
}

?>

 

Any help would be great.

Link to comment
https://forums.phpfreaks.com/topic/100961-trying-to-display-output-in-to-columns/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.