in effetti non sono stato la chiarezza in persona!
sono risucito ad avere i codice esatti
codice HTML:
* { margin: 0; padding: 0; }body { font-size:100%; font-family:Verdana,Georgia, "Times New Roman", Times, serif;}#contenitore { width:95%; margin: 50px auto;}p { margin: 20px 0; }/********* STILE GENERICO TABELLA **********/table { width: 100%; border-collapse: collapse; text-align: center; }th { background: #13571B; color: white; font-weight: bold; }td, th { padding: 10px; border: 1px solid #fff;}a:link {text-decoration: none; color:#333;}a:visited {text-decoration: none; color: #333;}a:hover {color: #F00;}
tr:nth-of-type(odd){ /* Alternanza Righe */background:rgba(102,255,153,1);}tr:nth-of-type(even){ /* Alternanza Righe */background:rgba(204,255,255,1);}a{text-decoration:none;color:#36F;line-height:50px;}
/********* MEDIA QUERY **********/ @media only screen and (min-width: 481px) and (max-width: 767px){ table, thead, tbody, th, td, tr { /* Forza la tabella a non essere più una tabella */display: block; } thead tr { /* Nascondiamo l'intestazione della tabella thead */position: absolute;top: -9999px;left: -9999px;}tr { border: 1px solid #666; } td { position: relative; /* Creiamo lo spazio per l'intestazione */padding-left: 50%; border:0;} td:before { position: absolute; /* Creiamo le altre celle per la descrizione */top: 8px;left: 20px;width: 40%; font-weight:bold;}/* inseriamo l'etichetta per ciascuna cella con il selettore nth-of-type */
td:nth-of-type(1):before { content: "Codice"; } td:nth-of-type(2):before { content: "Descrizione"; }td:nth-of-type(3):before { content: "Altezza cm"; }td:nth-of-type(4):before { content: "Lungh."; }td:nth-of-type(5):before { content: "Gr./M²"; }td:nth-of-type(6):before { content: "Spess. µ"; }td:nth-of-type(7):before { content: "Colore"; }td:nth-of-type(8):before { content: "Superf."; }td:nth-of-type(9):before { content: "Confez."; }td:nth-of-type(10):before { content: "Qta' per collo"; }td:nth-of-type(11):before { content: "Prezzo Euro"; }td:nth-of-type(12):before { content: "Qtà"; }}
@media only screen and (min-width: 320px) and (max-width: 480px){
table, thead, tbody, th, td, tr { /* Forza la tabella a non essere più una tabella */display: block; } thead tr { /* Nascondiamo l'intestazione della tabella thead */position: absolute;top: -9999px;left: -9999px;}tr { border: 1px solid #666; padding-top:20px;} td { position: relative; /* Creiamo lo spazio per l'intestazione */ line-height:50px;border:0;} td:before { position: absolute; /* Creiamo le altre celle per la descrizione */top: 0px;left: 0px;width: 100%; font-weight:bold;line-height:0px;top:5px;
}/* inseriamo l'etichetta per ciascuna cella con il selettore nth-of-type */
td:nth-of-type(1):before { content: "Codice"; } td:nth-of-type(2):before { content: "Descrizione"; }td:nth-of-type(3):before { content: "Altezza cm"; }td:nth-of-type(4):before { content: "Lungh."; }td:nth-of-type(5):before { content: "Gr./M²"; }td:nth-of-type(6):before { content: "Spess. µ"; }td:nth-of-type(7):before { content: "Colore"; }td:nth-of-type(8):before { content: "Superf."; }td:nth-of-type(9):before { content: "Confez."; }td:nth-of-type(10):before { content: "Qta' per collo"; }td:nth-of-type(11):before { content: "Prezzo Euro"; }td:nth-of-type(12):before { content: "Qtà"; }}}
qui riporto il php
Codice PHP:
<table id="index"> <thead> <tr class="intesta13"> <th>Codice</th> <th>Descrizione</th><?php if ($option_altezza1) { ?><th>Altezza cm </th> <?php } ?><?php if ($option_lunghezza1) { ?><th>Lungh. <?php echo $unimislunghezza;?></td> <?php } ?><?php if ($option_grammatura1) { ?><th>Gr./M²</th> <?php } ?><?php if ($option_spessore1) { ?><th>Spess. µ</th> <?php } ?><?php if ($option_colore1) { ?><th>Colore</th> <?php } ?><?php if ($option_superficie1) { ?><th>Superf.</th> <?php } ?><?php if ($option_confezione1) { ?><th>Confez.</th><?php } ?><th>Qta' per collo</th><th>Prezzo Euro</th> <th>Qtà </th> <th> </th> </tr> </thead> <tr> <td><?php echo $codicearticolo; ?></td><td align="left"> <a href="catalogo.php?codicearticolo=<?php echo trim($codicearticolo);?>"><b><?php echo $descrizionearticolo; ?></b></a></td><?php if ($option_altezza1) { ?> <td><?php echo number_format($altezza, 2, ',', '.'); ?></td> <?php } ?><?php if ($option_lunghezza1) { ?> <td><?php echo number_format($lunghezza, 2, ',', '.'); ?></td> <?php } ?><?php if ($option_grammatura1) { ?> <td><?php echo number_format($grammatura, 0, '', '.'); ?></td> <?php } ?><?php if ($option_spessore1) { ?> <td><?php echo number_format($spessore, 0, '', '.'); ?></td> <?php } ?><?php if ($option_colore1) { ?> <td><?php echo $colore; ?></td> <?php } ?><?php if ($option_superficie1) { ?> <td><?php echo $superficie; ?></td> <?php } ?><?php if ($option_confezione1) { ?> <td><?php echo $confezione; ?></td><?php } ?><td><?php echo number_format($qtaxcollo, 0, '', '.'); ?></td> <td><?php echo number_format($prezzoarticolonetto, 2, ',', '.'); ?></td></tbody></table>
dato che questa tabella deve essere responsive ho trovato in rete un aiuto nel file css riportato sopra ma sicuramente è da adattare..
quando il css riconosce che si tratta di mobile etcc attiva delle variazioni come vedrai, la cosa che non riesco a fare è come far capire al css se
deve o non deve essere interpretato per determinate colonne (cosa che in php riesco a fare).
ditemi che sono stato chiaro vi prego!!