-
Buongiorno a tutti, ho bisogno del vostro aiuto, il colspan nei vari <td> attualmente appare cosi_(nelle colonne metto delle intestazioni a caso, è tanto per farvi capire):
!-----------------------------NOME------------------------------| COGNOME | INDIRIZZO | ICONA MOSTRA DETTAGLI |
|------CAMPO1-------|------CAMPO2------|------CAMPO3------- |mentre vorrei che apparisse cosi:
| NOME | COGNOME | INDIRIZZO | ICONA MOSTRA DETTAGLI |
|-----CAMPO1------|-----CAMPO2-----|-----CAMPO3------ |Come posso fare?_In internet explorer funziona correttamente, ma in tutti gli altri browser no.
Ciao e grazie.Allego il codice completo:
<HTML> <HEAD> <TITLE></TITLE> <link rel=stylesheet href="css.css" type="text/css"> <link rel="stylesheet" type="text/css" href="niftyCorners.css"> <link rel="stylesheet" type="text/css" href="niftyPrint.css" media="print"> <script type="text/javascript" src="nifty.js"> </script> <script type="text/javascript"> window.onload=function(){ if(!NiftyCheck()) return; RoundedTop("div#nav li","transparent","#cf8d00"); RoundedBottom("div#nav li","transparent","#cf8d00"); } </script> <script> function mostradettagli(id) { d = document.getElementById("datiextra"+id); if (!d) return; if (d.style.display != "block") d.style.display = "block"; else d.style.display = "none"; } </script> </HEAD> <BODY> <?php $lettura_risultati=mysql_query("select id, nome_utente, tipo_struttura, nome_struttura, naz_struttura, luogo_struttura, mese_sogg, anno_sogg, titolo_rec, voto_struttura, voto_qualita_cam, voto_ristorante, voto_pulizia, voto_eff_servizi, testo_rec, date_format(data_ora_ins, '%d/%m/%Y - ore %H:%i:%s') as data_formattata, MATCH(nome_struttura, tipo_struttura, naz_struttura, luogo_struttura) AGAINST('". $_POST['nome_ric'] ." ". $_POST['tipo_ric'] ." ". $_POST['naz_ric'] ." ". $_POST['luogo_ric'] ."' IN BOOLEAN MODE) AS tot from recensioni where MATCH(nome_struttura, tipo_struttura, naz_struttura, luogo_struttura) AGAINST('". $_POST['nome_ric'] ." ". $_POST['tipo_ric'] ." ". $_POST['naz_ric'] ." ". $_POST['luogo_ric'] ."' IN BOOLEAN MODE) order by tot DESC"); if(mysql_num_rows($lettura_risultati)>0){ echo "<div id='menu'> <ul id='nav'> <li class='luogo'><a><h3>Luogo struttura</h3></a></li> <li class='nome'><a><h3>Nome struttura</h3></a></li> <li id='strutt'><a><h3>Tipo struttura</h3></a></li> <li id='meses'><a><h3>Mese soggiorno</h3></a></li> <li id='annos'><a><h3>Anno soggiorno</h3></a></li> </ul> </div>"; echo "<table id='maintable'>"; $flag_colore=0; while($scatola_temporanea=mysql_fetch_array($lettura_risultati)){ $nome_utente=$scatola_temporanea['nome_utente']; $tipo_struttura=$scatola_temporanea['tipo_struttura']; $nome_struttura=$scatola_temporanea['nome_struttura']; $naz_struttura=$scatola_temporanea['naz_struttura']; $luogo_struttura=$scatola_temporanea['luogo_struttura']; $mese_sogg=$scatola_temporanea['mese_sogg']; $anno_sogg=$scatola_temporanea['anno_sogg']; $titolo_rec=$scatola_temporanea['titolo_rec']; $voto_struttura=$scatola_temporanea['voto_struttura']; $voto_qualita_cam=$scatola_temporanea['voto_qualita_cam']; $voto_ristorante=$scatola_temporanea['voto_ristorante']; $voto_pulizia=$scatola_temporanea['voto_pulizia']; $voto_eff_servizi=$scatola_temporanea['voto_eff_servizi']; $testo_rec=$scatola_temporanea['testo_rec']; $data_ora_ins=$scatola_temporanea['data_formattata']; echo "<tr>"; if($flag_colore==0){ echo '<tr> <td class="sfondoquery"> '. $scatola_temporanea['luogo_struttura'] . ' </td> <td class="sfondoquery"> '. $scatola_temporanea['nome_struttura'] . ' </td> <td class="sfondoquery">'. $scatola_temporanea['tipo_struttura'] . ' </td> <td class="sfondoquery">'. $scatola_temporanea['mese_sogg'] . '</td> <td class="sfondoquery">'. $scatola_temporanea['anno_sogg'] . '</td> <td><img src="dettagli_2.png" onclick="mostradettagli('. $scatola_temporanea['id']. ')" /> </td>'; echo '<tr class="datiextra" id="datiextra' . $scatola_temporanea['id']. '"> <td class="sfondoquery" colspan="2"> ' . $scatola_temporanea['tipo_struttura']. '</td> <td class="sfondoquery" colspan="2">' . $scatola_temporanea['nome_struttura'] . '</td> <td class="sfondoquery">' . $scatola_temporanea['naz_struttura']. '</td> </tr>'; $flag_colore=1; } else{ echo '<tr> <td class="sfondoquery2"> '. $scatola_temporanea['luogo_struttura'] . ' </td> <td class="sfondoquery2"> '. $scatola_temporanea['nome_struttura'] . ' </td> <td class="sfondoquery2">'. $scatola_temporanea['tipo_struttura'] . ' </td> <td class="sfondoquery2">'. $scatola_temporanea['mese_sogg'] . '</td> <td class="sfondoquery2">'. $scatola_temporanea['anno_sogg'] . '</td> <td><img src="dettagli_2.png" onclick="mostradettagli('. $scatola_temporanea['id']. ')" /> </td>'; echo '<tr class="datiextra" id="datiextra' . $scatola_temporanea['id']. '"> <td class="sfondoquery2" colspan="2"> ' . $scatola_temporanea['tipo_struttura']. '</td> <td class="sfondoquery2" colspan="2">' . $scatola_temporanea['nome_struttura'] . '</td> <td class="sfondoquery2">' . $scatola_temporanea['naz_struttura']. '</td> </tr>'; $flag_colore=0; } echo "</tr>"; echo "</tr>"; echo "</tr>"; } echo "</table>"; } else{ echo "Non é stata inserita ancora nessuna recensione in questa sezione. Se hai piacere essere il primo, clicca nella scelta <a href=\"nrecensione.html\">Nuova Recensione</a>";} ?> <br /><div style="z-index:3" class="smallfont" align="center">SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.</div></BODY> </HTML>I files niftyCorners.css e niftyPrint.css non li allego perchè servono solo per fare gli angoli arrotondati.
Nel file css.css c'e':
body{ margin-left: .5cm; margin-right: .5cm; margin-top: 20%; background-image: url(/images/bg_7.jpg); background-position: top; background-attachment: scroll; background-repeat: no-repeat; background-color:#416525; font-family: Times, Courier, sans-serif; font-size: 10pt; } table#maintable{ width: 1100px; margin:auto; } td#main{ width: 150px; height: 65px; } a:link{ text-decoration: none; color: #009900 ; } a:visited{ text-decoration: none; color: Gray; } a:hover{ color: #ffff00; text-decoration: none; } .bred{ background-color:#FF0000; } .bwhite{ background-color:#FFFFFF; } .datiextra { display:none; } .query{ font-size: 22px; font-weight: 400; } .campi{ background-color: #416525; filter: alpha(opacity=50); opacity: 0.50; } .sfondoquery{ background-color: #FFFF00; filter: alpha(opacity=50); opacity: 0.50; } .sfondoquery2{ background-color: #C0C0C0; filter: alpha(opacity=50); opacity: 0.50; } div#menu{ width: 1300px; padding-top:30px; margin:auto; } ul#nav,ul#nav li{ list-style-type:none; margin:0; padding:0; } ul#nav li{ float:left; width:201px; margin-right:2px; text-align: center; } ul#nav a{ float:left; width:201px; padding: 2px 0 5px; text-decoration:none; background: #cf8d00; color: #000; } ul#nav li.activelink a,ul#nav a:hover{ color: #000; } ul#nav li.luogo,ul#nav li.luogo a{ width:260px;; } ul#nav li.nome,ul#nav li.nome a{ width:350px;; } -
Ciao,
se postassi direttamente il codice html che viene generato sarebbe più semplice capire cosa c'è che non va.Così ad occhio mi sembra che la pagina generi elementi <tr> uno all'interno dell'altro, mentre dovrebbero essere sequenziali.
Non <tr>..<tr>..</tr></tr> ma <tr>..</tr><tr>..</tr>Inoltre la prima riga è di 6 colonne, mentre la seconda (con i due colspan=2) è di 5 colonne.
Alessandro
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi