need help (Padding)

Discussion in 'JavaScript' started by gauravwebsoft, Jun 30, 2006.

  1. #1
    document.getElementById(id).style.paddingLeft = '20px';

    why this is not working
     
    gauravwebsoft, Jun 30, 2006 IP
  2. jimgillett

    jimgillett Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What are you trying to pad?
     
    jimgillett, Jun 30, 2006 IP
  3. gauravwebsoft

    gauravwebsoft Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i m padding in a table
     
    gauravwebsoft, Jun 30, 2006 IP
  4. gauravwebsoft

    gauravwebsoft Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    function alterpadbottom(id){


    if(document.getElementsByTagName){

    var table = document.getElementById(id);
    var rows = table.getElementsByTagName("tr");

    document.getElementById(id).style.paddingBottom = '20px';


    }
     
    gauravwebsoft, Jun 30, 2006 IP
  5. jimgillett

    jimgillett Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Assuming that the id you're passing to the function is correct (make sure the case and spelling is the same as the id you're referencing) try removing the if statement to see if the code will run through.

    If it still doesn't, alert each variable after you set it to verify the correct values are being set.
     
    jimgillett, Jun 30, 2006 IP
  6. gauravwebsoft

    gauravwebsoft Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i think its problem with the table.table is not used to padding.i have to first include cell margin then i can use padding.some 1 from other forum told me.
     
    gauravwebsoft, Jun 30, 2006 IP