Jump to content

Cell background become crazzy!


angelodev

Recommended Posts

Hi there, i designed a table as follow:

 

table.calendar {
width: 160px;
height: 150px;
table-layout: fixed;
text-align: center;
border-collapse: separate;
border-spacing: 1px;
border-color: #000000;
border-width: 1px;
border-style: solid;
empty-cells: hide;
background: #CCFFFF;	
}

td.caption
{
font-weight: bold;	
}

td.empty
{
	background: #FFFFFF;
}

td.today
{
	background: #FFFF99;
}

td.selected
{
	background: red;
}

 

the selected section is activated with the javascript onMouseOver event. The onMouseOut restore the original CSS section.

 

I'm in trouble with the today section (the table is a calendar). initially it's correctly colored and also the onMouseOver event works well, but when the onMouseOut occurs the background doesn't come back to the correct setion and the cell take the general setting of the table, no more td.today.

 

Here the is the Javascript Code

 			 	if (($startdate == date("j")) && ($month == date("n")) && ($year = date("Y"))){
					?><TD class="today"  onmouseover = "this.className = 'selected';" onmouseout = "this.className = 'today;'"><?php echo (date("j")); ?></Td><?php
				} else {
				 ?><TD class="notoday" onmouseover = "this.className = 'selected';" onmouseout = "this.className = '			notoday;'"><?php echo ($startdate); ?></Td><?php

 

Thank in advice for your gold help!!!

Link to comment
https://forums.phpfreaks.com/topic/50403-cell-background-become-crazzy/
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.