Bigginer needs help :D

Discussion in 'JavaScript' started by Lipgut, Apr 25, 2009.

  1. #1
    I am kinda learning the basics of javascript right now but I am deffinly don't know it well enough to do what I want to do..

    so my code is something like this ;
    
    <table width="100">
      <td>eh?</td>
    </table>
    
    HTML:
    Simple , I want to be able to control the width of my table using an input box. So I would type in "1000" and the width of my table would become 1000. I don't know if this is possible and I need a little help. So if someone could tell me how to do it , direct me in the right path or even give me a tut on how to do it , it would be most appriecated!

    thank you for reading.
     
    Lipgut, Apr 25, 2009 IP
  2. Cylestyne

    Cylestyne Peon

    Messages:
    92
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    CSS and DHTML is what you're actually looking for, try looking up some DHTML and CSS tutorials on google, it should be fairly easy.
     
    Cylestyne, Apr 25, 2009 IP
  3. Lipgut

    Lipgut Member

    Messages:
    328
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    35
    #3
    Thanks , I'll see if I can do it this way. I just thought it would be more a java thing then anything else , but then again I am a begginer :D
     
    Lipgut, Apr 25, 2009 IP
  4. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #4
    you are correct, you'd use javascript to access css properties of the table, namely the style.width - so you need to assign it an id and access as document.getElementById("blah").style.width = etc.
     
    dimitar christoff, Apr 26, 2009 IP