Visualizzazione dei risultati da 1 a 5 su 5
  1. #1
    Utente di HTML.it L'avatar di Grinder
    Registrato dal
    Mar 2003
    Messaggi
    1,374

    Funzione per impostare l'altezza

    Vorrei impostare l'altezza di una tabella in base alla risoluzione dello schermo con questa funzioncina, ma evidentemente sbaglio qualcosa perchè non va...cosa mi manca?
    codice:
    <script language="javascript">
    function altezza(tabella) {
    document.tabella.write(screen.height);
    }
    </script>
    <table width="100%" id="maintable" onload="altezza(maintable);" border="0" cellspacing="0" cellpadding="0">

  2. #2
    Utente di HTML.it
    Registrato dal
    Aug 2002
    Messaggi
    8,013
    sì...
    prova:

    document.getElementById(tabella).height = screen.height;
    <´¯)(¯`¤._)(¯`»ANDREA«´¯)(_.¤´¯)(¯`>
    "The answer to your question is: welcome to tomorrow"

  3. #3
    Utente di HTML.it L'avatar di Grinder
    Registrato dal
    Mar 2003
    Messaggi
    1,374
    No niente, continua ad ignorare lo script. Ho messo anche gli apici in onload="altezza('maintable');", ma niente

  4. #4
    Utente di HTML.it
    Registrato dal
    Aug 2002
    Messaggi
    8,013
    codice:
    <html>
    <head>
    <script language="javascript">
    
    function resizeTable(t) {
      document.getElementById(t).style.height = screen.height;
    
    }
    
    </script>
    <body>
    <table id="tabella" width="600px" style="border: 1px solid #000000;">
      <tr>
        <td>Hello</td><td>There</td><td>How are you doing!?</td>
      </tr>
      <tr>
        <td>Hello</td><td>There</td><td>How are you doing!?</td>
      </tr>
      <tr>
        <td>Hello</td><td>There</td><td><input type="button" value="Resize me" onClick="resizeTable('tabella');"></td>
      </tr>
    </table>
    </body>
    <´¯)(¯`¤._)(¯`»ANDREA«´¯)(_.¤´¯)(¯`>
    "The answer to your question is: welcome to tomorrow"

  5. #5
    Utente di HTML.it L'avatar di Grinder
    Registrato dal
    Mar 2003
    Messaggi
    1,374
    yessssssssss, bisognava mettere onload nel body!!! Grazie mille

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.