Jump to content

Creating a HTML grid using php


MemphiS

Recommended Posts

What i wish to do is have a picture of a map in the background with a grid on top like the html example below.

 

<code>

<table cellpadding=2 cellspacing=0 border=0 width=500>

<tr><td background=myimage.gif>

 

<table cellpadding=0 cellspacing=0 border=0>

??????

</table>

 

</td></tr>

</table>

</code>

 

I need to fill a grid in the ?????? section.

 

Ive tried for(); but that isnt working as every 20 rows i need to add the <tr></tr> for a new line it also needs to be 30 rows long...

 

Thanks for your help./

Link to comment
https://forums.phpfreaks.com/topic/82497-creating-a-html-grid-using-php/
Share on other sites

This might help

 

<?php
$numinrow = 7;      

for( $counter = 1; $counter <= $numdaysinmonth; $counter ++ ) 
{
if (in_array($counter,$arrDays))
{		
for ($i=$counter;$i<=$counter;$i++)	
{  
$event = implode("<P>",$arrEvent[$i]);
echo "<td><a href=#>$counter<span>$event</span></td></a>";
$rowcounter ++;      
}
}
else	
{	
echo "<td>$counter</td>"; 
$rowcounter ++;      
}


if($rowcounter == $numinrow) 
{            
echo "\t</tr>\n";           
}         
}
that is for a calendar. While counter is less the seven print a new column. When counter is over 7 start a new row

if( $counter < $numdaysinmonth ) 
{                           
echo "\t<tr>\n";      
$rowcounter = 0;                                        
}    
?>

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.