Newbie needs help with align right (form)

Discussion in 'CSS' started by cjames83, Feb 23, 2009.

  1. #1
    I have inserted a form into a website I'm building. I have aligned it to the right : <TABLE ALIGN="right" BORDER="0" CELLSPACING="1">

    Now, how can I make it so that the form isn't directly up against the right hand side. In other words, could I use padding, and if so how would I do it? I would like the form to stay roughly about an inch from the right hand side of the screen. Thanks!
     
    cjames83, Feb 23, 2009 IP
  2. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you can add right-padding to your <td> that contains the form

    so for example..
    
    <TABLE ALIGN="right" BORDER="0" CELLSPACING="1">
    <tr>
    <td style="padding-right:10px"><form ...></form>
    </td>
    </tr>
    </table>
    HTML:
    would add 10 pixels space between the form and the td
     
    gnp, Feb 23, 2009 IP
  3. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I would recommend doing this in CSS instead of in the table. This way you can reference items later and have multiple tables and forms using it throughout the site.

    
     table
     { float:right; }
    
     form
     { padding-right:10px; }
    
    Code (markup):
     
    LeetPCUser, Feb 24, 2009 IP
  4. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if you float the table i believe it would be better to put a margin-right and not a padding..
     
    gnp, Feb 24, 2009 IP
  5. 007c

    007c Peon

    Messages:
    611
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    A margin there will double with float in explorer..
     
    007c, Feb 24, 2009 IP
  6. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #6
    :) not if you put display:inline in the rule as well ;)
     
    gnp, Feb 24, 2009 IP
  7. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #7
    This discussion ignores the basic question: Why are tables being used for this, in the first place?

    cheers,

    gary
     
    kk5st, Feb 24, 2009 IP
  8. 007c

    007c Peon

    Messages:
    611
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Not sure he woulda known that :p
     
    007c, Feb 26, 2009 IP