PHP Calender

Hi all i am developing an Application for a client and having diffuailty making this simple calender be sized with in the width of atleast 190px and 85 px for height

This is a just using a forloop and not sure what i am exactly doing wrong to get this not sit in the correct width and height specs?

Is there somthing wrong with my php code?


$day=date('d');
	$month=date('m');
	$year=date('Y');
	//
	$first_day = mktime(0,0,0,$month,1,$year);
	$title = date('F',$first_day);
	$day_of_week = date('D',$first_day);
	//
	switch($day_of_week)
	{
		case "Sun" : $blank = 0;
		break;
		case "Mon" : $blank = 1;
		break;
		case "Tue" : $blank = 2;
		break;
		case "Wed" : $blank = 3;
		break;
		case "Thu" : $blank = 4;
		break;
		case "Fri" : $blank = 5;
		break;
		case "Sat" : $blank = 6;
		break;	
	}
	//

	//
	$days_in_month = cal_days_in_month(0,$month,$year);
	
	echo "<table width='130px' height='55px'>";
	echo "<tr><th colspan='7'>".$title."&nbsp;".$year."</th></tr>";
	echo "<tr><td>Sun</td>
	<td>Mon</td>
	<td>Tue</td>
	<td>Wed</td>
	<td>Thur</td>
	<td>Fri</td>
	<td>Sat</td>
	</tr>";
	$date_count = 1;
	echo "<tr>";
	while($blank>0)
	{
		echo "<td></td>";
		$blank = $blank -1;
		$day_count++;	
	}
	$day_num = 1;
	while($day_num <=$days_in_month)
	{
		echo "<td>".$day_num."</td>";
		$day_num++;
		$day_count++;
		if($day_count>7)
		{
			echo "</tr><tr>	";
			$day_count = 1;
		}	
	}
	while($day_count>1 && $day_count<=7)
	{
		echo "<td></td>";
		$day_count++;	
	}
	echo "</tr></table>";
function cal_days_in_month($month, $year)
{
   return $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year %400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);
 	}

Thanks,Willim

Maybe because you’re specifying different dimensions here:


echo "<table width='130px' height='55px'>";

does that seem correct to you though immerse??