Benötigen Sie einen Bildlauf Zelle in einer html Tabelle

Ich habe eine html-Tabelle enthält eine Zelle wird eine Menge von Daten (vielleicht 200 Zeilen).
Anstatt dass meine Seite zu scrollen, will ich meine Zelle in der Tabelle zu Blättern.

Ich verstehe, dass ich brauche eine div block, dies zu tun. Definierte ich ein div-block in meinem
css-Datei, aber es ist nicht nehmen.

Wie behebe ich die Höhe meiner Zelle und gebe meine Daten ein scrollbar?

--------html Tabelle-----------

<table class="cmain">
  <tr>
    <td>  TOP LEFT CELL <p>
        <table> <tr> <td> A sub-table goes here </td> </tr> </table>
    </td>
    <td>  TOP RIGHT CELL <p>
       <p> A PHOTO GOES HERE.
       <p> PHOTO: {{ form.image }}
   </td>
   <td rowspan="2" valign="top" > 
       THIS IS THE CELL THAT NEEDS THE SCROLL BAR.  <div id="scrollcell">
           SCROLLER CELL <hr>
            <p> {% for customer in customer_list  %}
            <p> {{ customer }} </p>
           {% endfor %}
       </div>
   </td>
  </tr>
  <tr>
<td> Another Sub-table goes here.
        <table> <tr> <td> A sub-table goes here </td> </tr> </table>
</td> 
   <td> A NOTES FORM FIELD GOES HERE <p>
     {{ form.notes }} </td>
 </tr>
</table> <!-- end of CMAIN table -->

--------css -----------

table, th, td {
        border: 1px solid white;
}

table.cmain {
        border: 1px solid blue;
}

table.cmain td { 
        border: 1px solid blue;
    font-weight: bold;
        /*width: 300;*/
        padding: 3px; 
    font-size: 0.8em;
}

#scrollcell {
        width: 50px;
        height: 50px;
        overflow: auto;
}
InformationsquelleAutor codingJoe | 2011-10-23
Schreibe einen Kommentar