Salve a tutti.
Ho un piccolo problema di visualizzazione dati utilizzando codice HTML/JAVASCRIPT/PHP che succede solamente con CHROME mentre con Internet Explorer funziona bene.
Il codice in formato php e' il seguente:
Perche' in alcuni giorni la colonna viene "allargata" in modo incomprensibile?codice:<? ?> <html> <head> <style type="text/css"> TABLE { line-height: 12px; font-size: 6pt; border: 0; border-spacing: 0; height: 9px; margin: 0; vertical-align: top; } INPUT { line-height: 12px; font-size: 6pt; border: 0; border-spacing: 0; height: 9px; margin: 0; vertical-align: top; } .inp { font: normal 9px Verdana, fantasy; color: #000000; background-color: transparent; text-align: right; border: 0px; margin: 0px; padding: 0px; height: 10px; width: 14px; } </style> </head> <body> <script type="text/javascript" language="JavaScript"> var Today_Anno = ""; var Today_Mese = ""; var Today_Giorno = ""; var Tab_Mese = new Array(); Tab_Mese[0] = ""; Tab_Mese[1] = "Gennaio"; Tab_Mese[2] = "Febbraio"; Tab_Mese[3] = "Marzo"; Tab_Mese[4] = "Aprile"; Tab_Mese[5] = "Maggio"; Tab_Mese[6] = "Giugno"; Tab_Mese[7] = "Luglio"; Tab_Mese[8] = "Agosto"; Tab_Mese[9] = "Settembre"; Tab_Mese[10] = "Ottobre"; Tab_Mese[11] = "Novembre"; Tab_Mese[12] = "Dicembre"; var Tab_Week = new Array(); Tab_Week[0] = ""; Tab_Week[1] = "Lu"; Tab_Week[2] = "Ma"; Tab_Week[3] = "Me"; Tab_Week[4] = "Gi"; Tab_Week[5] = "Ve"; Tab_Week[6] = "Sa"; Tab_Week[7] = "Do"; function Init_Data(){ Today_Giorno = 4; Today_Mese = 12; Today_Anno = 2011; var GG_Inizio_Mese = new Date(Today_Anno + '/' + Today_Mese + '/01'); var WW_Inizio_Mese = GG_Inizio_Mese.getDay(); if (WW_Inizio_Mese == 0) { WW_Inizio_Mese = 7; } var Data_Fine_Mese = new Date(Today_Anno, Today_Mese, 0); var GG_Fine_Mese = Data_Fine_Mese.getDate(); document.forms[0].Anno.value=Today_Anno; document.forms[0].Mese.value=Tab_Mese[Today_Mese]; for (ctr = 1; ctr < 8; ctr = ctr + 1) { eval('document.getElementById("G_' + ctr + '").innerHTML=Tab_Week[ctr];'); } var ctr_gg = 0; for (; ctr < 50; ctr = ctr + 1) { if (((ctr-7) > 0 & (ctr-7) < 8) & (ctr-7) < WW_Inizio_Mese) { ; } else if ((ctr_gg + 1) > GG_Fine_Mese) { ; } else { ctr_gg = ctr_gg + 1; eval('document.getElementById("G_' + ctr + '").innerHTML=ctr_gg;'); if (Today_Anno == Today_Anno & Today_Mese == Today_Mese & ctr_gg == Today_Giorno) { eval('document.getElementById("G_' + ctr + '").style.border="solid 1px black";'); } } } } </script> <form> <table width=20% cellspacing=0 cellpadding=0 border=0> <tr> <td align="center" style="height:9px;line-height:9px;font-size:9px"> <a href="#" onMouseOver="window.status=' '; return true" onMouseOut="window.status=' '" </a> <input type=text class="inp" disabled title="" name="Anno" style="font: normal 7pt Verdana, fantasy; text-align: center; height: 12px; width: 60px; margin-top: -1; margin-right: 0; margin-bottom: -1; margin-left: 0; "> <a href="#" onMouseOver="window.status=' '; return true" onMouseOut="window.status=' '" </a> </td> </tr> <tr> <td align="center" style="height:9px;line-height:9px;font-size:9px"> <a href="#" onMouseOver="window.status=' '; return true" onMouseOut="window.status=' '" </a> <input type=text class="inp" disabled title="" name="Mese" style="font: normal 7pt Verdana, fantasy; text-align: center; height: 12px; width: 60px; margin-top: -1; margin-right: 0; margin-bottom: -1; margin-left: 0; "> <a href="#" onMouseOver="window.status=' '; return true" onMouseOut="window.status=' '" </a> </td> </tr> <tr> <td align="center" style="font: normal 1pt Verdana, fantasy; width: 2px; "> </td> </tr> </table> <table width=20% cellspacing=0 cellpadding=0 border=0> <tr> <? for ($ctr_all = 1; $ctr_all < 50; $ctr_all++) { ?> <td align="center" title="" id="G_<? echo $ctr_all; ?>" style=" height: 9px; line-height: 9px; font-size: 9px; font: normal 6pt Verdana, fantasy; color: #000000; background-color: transparent; text-align: right; border: 0 0 0 0; width: 8px; margin-top: 0; margin-right: 0; margin-bottom: -1; margin-left: 0; "> </td> <td align="center" style="font: normal 1pt Verdana, fantasy; width: 2px; "> </td> <? if ($ctr_all % 7 == 0) { // se il resto della divisione di ctr e' uguale a 0 ?> </tr> <tr> <td align="center" style="font: normal 1pt Verdana, fantasy; width: 2px; "> </td> </tr> <tr> <? } } ?> </tr> </table> </form> </body> <script type="text/javascript" language="JavaScript"> Init_Data(); </script> </html> <? ?>
Ad esempio, nei giorni
4
6
7
13
14
20
21
27
28
del mese di dicembre 2011
grazie a tutti

Rispondi quotando
