Jump to content

Three Columns


twistedindustries

Recommended Posts

Hi I have a code snippet that I am working with that generates two column layout.  I simply would like to make it a three column instead.  How do I do it?

 

Here is the code:

				<table width="100%" align="center" cellpadding="3" cellspacing="3" style="border:0px solid #F8F8F8;">
<?php				
			$tot = count($tl_id);
			for ($m=0;$m<count($tl_id);$m=$n+1) 
			{
				$n = $m + 1;
				$show_m = $show_n = 0;
				if ($m < $tot) 
				{
					$show_m = 1;
					$m_ch_id = $m_ch_name = $m_ch_desc = array();
					jvlinx_util::get_my_subcategories($tl_id[$m], $m_ch_id, $m_ch_name, $m_ch_desc);						
				}	
				if ($n < $tot) 
				{
					$show_n = 1;
					$n_ch_id = $n_ch_name = $n_ch_desc = array();
					jvlinx_util::get_my_subcategories($tl_id[$n], $n_ch_id, $n_ch_name, $n_ch_desc);						
				}
?>				
			  <tr valign="top">
			    <td width="33%" height="30" align="center" valign="middle"><div align="center">
				<?php 
				if ($show_m) 
				{
					$resp = HTML_jvlinx::display_directory_category($option, $Itemid, $tl_id[$m], $tl_name[$m], $tl_desc[$m], "TOPLEVEL");
					echo $resp;
				}	
				?>
				</div></td>
		        <td width="33%" height="30" align="center" valign="middle"><div align="center" >
				<?php 
				if ($show_n) 
				{
					$resp = HTML_jvlinx::display_directory_category($option, $Itemid, $tl_id[$n], $tl_name[$n], $tl_desc[$n], "TOPLEVEL");
					echo $resp;
				}	
				?>
				</div>
			  </tr>
			  <tr valign="top">
			    <td height="30" align="center"><div align="center" >
<?php
				if ($show_m)
				{
					for ($ret="",$i=0;$i<count($m_ch_id);$i++)
						$ret .= HTML_jvlinx::display_directory_category($option, $Itemid, $m_ch_id[$i], $m_ch_name[$i], $m_ch_desc[$i], "SUBLEVEL") . ", ";
					$ret = substr($ret, 0, strlen($ret)-2);	
					echo $ret;
				}	
?>																	
				</div></td>
			    <td height="30" align="center"><div align="center" >
<?php
				if ($show_n)
				{
					for ($ret="",$i=0;$i<count($n_ch_id);$i++)
						$ret .= HTML_jvlinx::display_directory_category($option, $Itemid, $n_ch_id[$i], $n_ch_name[$i], $n_ch_desc[$i], "SUBLEVEL") . ", ";
					$ret = substr($ret, 0, strlen($ret)-2);	
					echo $ret;
				}	
?>												
				</div></td>
		      </tr>
<?php
			}


?>				
			<tr><td colspan="2"><?php HTML_jvlinx::autoXchange($option, $Itemid); ?></td></tr>  
</table>

Link to comment
https://forums.phpfreaks.com/topic/125515-three-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.