HTML+CSS in box di testo

  1. 3 years ago

    Buongiorno
    Sto cercando d'inserire delle tabelle di testo formattate direttamente in html+css, ma il rendering è diverso da quello che ho in safari/crome, quali limitazioni o attenzioni vanno poste?
    Di seguito il codice.
    Grazie mille x il supporto

    /* Table SMG inizio */
    table {
    font-family: GillSansStd;
    font-size: 10pt;
    color: #000000;
    line-height: 15pt;
    border-color: #000000;
    border-collapse: collapse;
    border: 1pt solid black;
    table-layout: fixed;
    width: 557px;
    border-spacing: 0;
    }

    th { /* Table Header */
    font-weight: bold;
    border: 1pt solid #000;
    border-bottom: 2pt solid #000;
    /* height:12pt;*/
    line-height: 11pt;
    text-align: center;
    vertical-align: middle;
    padding-top: 0.5em;
    }

    td { /* Table Column */
    text-align: center;
    vertical-align: middle;
    border: 0.5pt solid black;
    width: auto;
    padding-left: 0.5em;
    padding-top: 0.3em;
    }

    tr { /* Table Row */
    text-align: center;
    vertical-align: middle;
    height:12pt;
    line-height: 18pt;

    }

    /* Table Alternatee Row color */
    tr:nth-child(even) {background: #F2F2F2}
    tr:nth-child(odd) {background: #FFF}

    /* Table SMG fine */

    <table>
    <thead>
    <tr>
    <th>Streefwaarde % </th>
    <th>Gemeten waarde % </th>
    <th>TVI toonwaardetoename </th>
    <th>Waarde compenseren </th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>0 </td>
    <td>0,0 </td>
    <td>0,0 </td>
    <td>0,0 </td>
    </tr>
    <tr>
    <td>10 </td>
    <td>32,3 </td>
    <td>17,6 </td>
    <td>4,4 </td>
    </tr>
    <tr>
    <td>20 </td>
    <td>49,4 </td>
    <td>32,0 </td>
    <td>9,9 </td>
    </tr>
    <tr>
    <td>30 </td>
    <td>62,1 </td>
    <td>45,7 </td>
    <td>17,7 </td>
    </tr>
    <tr>
    <td>40 </td>
    <td>72,4 </td>
    <td>58,2 </td>
    <td>26,7 </td>
    </tr>
    <tr>
    <td>50 </td>
    <td>81,0 </td>
    <td>68,7 </td>
    <td>36,4 </td>
    </tr>
    <tr>
    <td>60 </td>
    <td>87,1 </td>
    <td>78,0 </td>
    <td>46,1 </td>
    </tr>
    <tr>
    <td>70 </td>
    <td>91,4 </td>
    <td>85,1 </td>
    <td>57,0 </td>
    </tr>
    <tr>
    <td>80 </td>
    <td>95,3 </td>
    <td>91,0 </td>
    <td>68,0 </td>
    </tr>
    <tr>
    <td>90 </td>
    <td>98,3 </td>
    <td>95,8 </td>
    <td>81,1 </td>
    </tr>
    <tr>
    <td>100 </td>
    <td>100,0 </td>
    <td>100,0 </td>
    <td>100,0 </td>
    </tr>
    </tbody>
    </table>

  2. Anna S 2

    1 Dec 2020 Administrator

    Buongiorno Sergio,

    ho provato ad inserire il codice all'interno di PubCoder e mi sembra ok anche in export HTLM5. Che problematiche riscontri?

    Anna

  3. Inserito, ma non vengono visualizzati i colori in Pubcoder

    la sintassi:
    tr:nth-child(even) {background: #F2F2F2}
    tr:nth-child(odd) {background: #FFF}

    non produce nessun risultato

    .SCText tr:nth-child(even) {background: #F2F2F2}
    .SCText tr:nth-child(odd) {background: #FFF}

    anche questa non produce nessun risultato, sembra essere ignorata

    Sto cercando di fare delle tabelle con righe e celle colorate, ma senza risultati

    Soluzioni?
    Grazie

 

or Sign Up to reply!