DHTML - Problema con tablas y FireFox

 
Vista:

Problema con tablas y FireFox

Publicado por Oscaro (1 intervención) el 04/08/2006 00:11:53
saludos.

veran tengo una rutina para crear un calendario usando javascript, el calendario se ve bien en internet explorer y en netscape, pero en firefox no, las columnas vacias son mas pequeñas, que las que tienen datos en lugar de ser todas del mismo tamaño.

Esta es la rutina,

cualquier ayuda o comentario gracias de antemano.

<html>
<head>
<style type="text/css">

.main {
border:1px solid black;
}

.month {
background-color:black;
font:bold 12px verdana;
color:white;
}

.daysofweek {
background-color:gray;
font:bold 12px verdana;
color:white;
text-align:center;
}

.days {
font-size: 12px;
font-family:tahoma; /* verdana */
color:black;
padding: 1px;
text-decoration:none;
text-align:center;
}

.today{
font-weight: bold;
color:red;
text-decoration : none;
}

</style>

<script language="javascript">

function buildCal(m, y, cM, cH, cDW, cD, brdr)
{
var x;
var fecha;
var mn=['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'];
var dim=[31,0,31,30,31,30,31,31,30,31,30,31];

var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st

var todaydate=new Date();
var scanfortoday=(y==todaydate.getFullYear() && m==todaydate.getMonth()+1)? todaydate.getDate() : 0;

dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;

var t='<div class="' + cM + '">';
t+='<table class="' + cM + '" border="' + brdr + '" cellspacing="0" bgcolor="white">';
t+='<tr><td colspan="7" width="100%" class="' + cH + '" align="center">Consultar día </td></tr>';
t+='<tr><td colspan="7" width="100%" class="' + cH + '" align="center">' + mn[m-1] +' - ' + y + '</td></tr>';

t+="<tr>";
for(s=0;s<7;s++){
t+='<td class="'+cDW+'">'+"DLMMJVS".substr(s,1)+'</td>';
}
t+="</tr>";

t+='<tr>';

for(i=1;i<=42;i++)
{
x = ((i-oD.od>=0) && (i-oD.od<dim[m-1]))? i-oD.od+1 : '-  ';
fecha = y+ '-' + ((m<10)?('0'+m):m) + '-' + ((x<10)?('0'+x) : x ) ;

if(x==scanfortoday){
t+='<td><div id="today"><a href="pag.asp?fecha=' + fecha + '&estado=1" class="today" target="frame-centro">' + x +'</a></div></td>'; //DD added
}
else if(x<scanfortoday) {
t+='<td class="' + cD + '"><a href="pag.asp?fecha=' + fecha + '&estado=1" target="frame-centro">' + x + '</a></td>';
}
else{
t+='<td class="' + cD + '">' + x + '</td>';
}

if(((i%7)==0)&&(i<36))
t+='</tr><tr>';
}//fin for...

t+='</tr></table></div>';
return t;
}
</script>

</head>
<body>
<script language="javascript">
var todaydate=new Date();
var curmonth=todaydate.getMonth()+1; //get current month (1-12)
var curyear=todaydate.getFullYear(); //get current year
var Calendario = buildCal(curmonth ,curyear, "main", "month", "daysofweek", "days", 1);
document.write( Calendario );
</script>

</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder