Visualizzazione dei risultati da 1 a 10 su 10

Discussione: tabella con scroll

  1. #1

    tabella con scroll

    Ciao,

    avrei bisogno di usare una classica tabella in html ma con la possibilità di tenere sempre l'intestazione allineata e visualizzare il contenuto tramite la scroll bar.
    Ne ho usata una ma funziona solo con IE e con delle tabelle più complesse sbaglia il calcolo dell'area libera nella pagina.
    Cmq quella che è usato è questa.

    http://www.codeproject.com/KB/script...ble_table.aspx

    Volevo sapere se qualcuno ha avuto la stessa mia necessità e come ha risolto.
    live free or die

  2. #2
    Se sai impaginare i tuoi dati puoi procedere così
    Fantasupermegafavolipermeramagicultra irresistibili
    4 10 30 100 1001 personaggi insuperabili fantaincredibili ultraimpossibili iperterribili irresistibili!!!

    "... a quell'età ... bastava un dito per fare la pace ..."
    fotine

  3. #3
    L'unica cosa che non mi convince che bisogna usare 2 tabelle separate e poi magari nn si allieano bene...ora provo grazie.
    live free or die

  4. #4
    Originariamente inviato da Kandalf
    L'unica cosa che non mi convince che bisogna usare 2 tabelle separate e poi magari nn si allieano bene...ora provo grazie.
    Infatti ho scritto (come anche nel blog) che devi saper impaginare i dati. Proprio perchè le misure sono in px per non sperdere l'impaginazione.
    Penso sia fattibile anche in percentuale ma bisognerebbe perderci un po' di tempo...
    Fantasupermegafavolipermeramagicultra irresistibili
    4 10 30 100 1001 personaggi insuperabili fantaincredibili ultraimpossibili iperterribili irresistibili!!!

    "... a quell'età ... bastava un dito per fare la pace ..."
    fotine

  5. #5
    Con Firefox basterebbe questo per gestirlo:

    Codice PHP:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
    <
    html>
    <
    head>
    <
    title>Scrolling Table Body</title>
    <
    style type="text/css">
    table.scroll {
    height50px;
    overflowscroll;
    }
    table.scroll tbody {
    height300px;
    overflow-yauto;
    overflow-xhidden;
    }
    table.scroll tbody trtable.scroll tbody td {
    heightauto;
    }
    </
    style>
    </
    head>
    <
    body>
    <
    table class="scroll">
    <
    thead>
    <
    tr>
    <
    th>HeaderAAAAAAAAAAAA</th>
    <
    th>Header 2</th>
    <
    th>Header 3</th>
    <
    th width="15"></th>
    </
    tr>
    </
    thead>

    <
    tbody>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 1Cell 1</td>
    <
    td>Row 1Cell 2</td>
    <
    td>Row 1Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 2Cell 1</td>
    <
    td>Row 2Cell 2</td>
    <
    td>Row 2Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 3Cell 1</td>
    <
    td>Row 3Cell 2</td>
    <
    td>Row 3Cell 3</td>
    </
    tr>
    <
    tr>
    <
    td>Row 4Cell 1</td>
    <
    td>Row 4Cell 2</td>
    <
    td>Row 4Cell 3</td>
    </
    tr>
    </
    tbody>
    </
    table>
    </
    body>
    </
    html
    live free or die

  6. #6
    Utente bannato
    Registrato dal
    Sep 2009
    Messaggi
    1,737
    C'è un modo per risolvere il problema, abbastanza semplice: facendo la struttura esterna tabella e thesd con codice html e inserendo i dati con javascript, (document.write()), il che garantisce uno scroll con tutti i browser

  7. #7
    Occhio all'accessibilità...
    Fantasupermegafavolipermeramagicultra irresistibili
    4 10 30 100 1001 personaggi insuperabili fantaincredibili ultraimpossibili iperterribili irresistibili!!!

    "... a quell'età ... bastava un dito per fare la pace ..."
    fotine

  8. #8
    Non ho problemi di accessibilità visto che mi serve per un'applicazine in intranet.

    Visto che la pagina e la relativa tabella è già costruita e abbastanza complessa e piena di dati mi serviva un modo più veloce possibile. Quello che ho trovato nel link per adesso è quelo migliore anche se andrebbe rivisto.
    live free or die

  9. #9
    Utente bannato
    Registrato dal
    Sep 2009
    Messaggi
    1,737
    Originariamente inviato da ricman
    Occhio all'accessibilità...
    Ti do ragione quando c'è di mezzo javascript, l'accessibilità è sempre precaria, ma come si dice quando ce vo ce vo, poi per te che sei un cultore di ajax e jquery, non dovrebbe impressionare

  10. #10
    Originariamente inviato da miki003
    Ti do ragione quando c'è di mezzo javascript, l'accessibilità è sempre precaria, ma come si dice quando ce vo ce vo, poi per te che sei un cultore di ajax e jquery, non dovrebbe impressionare
    Occhio al CULtOre ...
    Il mio culto è volto più al codice puro con css e qualche foto...


    Vabbè... leggo che è per una intranet... quindi non possibilità di sbagliare su chi usa il suo programmino.
    Quindi ok... andate col javascript...
    Fantasupermegafavolipermeramagicultra irresistibili
    4 10 30 100 1001 personaggi insuperabili fantaincredibili ultraimpossibili iperterribili irresistibili!!!

    "... a quell'età ... bastava un dito per fare la pace ..."
    fotine

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.