Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Dimensionamento dinamico tabelle in altezza

    Ho un problema per un mio sito che semplifico così:

    ho due tabelle una sotto e una sopra, quella sotto varia in altezza a seconda dei contenuti...quella sopra sarebbe il "rivestimento" e deve sempre inseguire quella sotto e avere la stessa altezza.

    Mi servirebbe un javascript che mi faccia coincidere sempre l'altezza di quella sopra con l'altezza di quella sotto.

    l'esempio è questo:

    link

    e il codice che per ora ho quest'altro:

    Codice PHP:
    <div id="Layer2" style="position:absolute; width:300; height:150; z-index:1; left: 0px; top:0px;">
      <
    table width="450" height="800" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
        <
    tr>
          <
    td height="200">gdfgfd</td>
          <
    td>gfdgfd</td>
        </
    tr>
        <
    tr>
          <
    td width="50%" height="200">gfdgfd</td>
          <
    td width="50%">gfdgfdfdsfdsfds</td>
        </
    tr>
        <
    tr>
          <
    td height="200"></td>
          <
    td></td>
        </
    tr>
      </
    table>
    </
    div>
    <
    div id="Layer3" style="position:absolute; width:500; height:800; z-index:3; left: 0px; top: 0px;">
      <
    table width="500" border="1" cellpadding="0"  cellspacing="0" bordercolor="#FF0000">
        <
    tr>
          <
    td height="100" bgcolor="#FF0000"></td>
        </
    tr>
        <
    tr>
          <
    td height="300"></td>
        </
    tr>
        <
    tr>
          <
    td height="100" bgcolor="#FF0000"></td>
        </
    tr>
      </
    table></div

  2. #2
    nessuno che lo sa?...

    mia sorella è molto carina eh!

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    2,125
    se e' giusto manda in pvt il numero di tua sorella

    assegna un id alle 2 tabelle

    tipo
    <table id="id_1"></table>
    <table id="id_2"></table>



    poi fai ...
    Codice PHP:
    window.onload=function(){

    document.getElementById('id_1').style.height document.getElementById('id_2').style.height ;



    oppure cosi

    Codice PHP:
    window.onload=function(){

    document.getElementById('id_1').height document.getElementById('id_2').height ;




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.